Thursday, 21 July 2016

Weeks over Threshold

Highlight all of the weeks that are above a given threshold. Then for all of the weeks in a row above that given threshold, label the last week in the series with the number of weeks in a row.

Step 1:-

Create a parameter so that the end user can enter a threshold.


Step 2:-

 Create a boolean calculation that returns true if the sum is above or and false if the sum is below the threshold.

Step3:-

Drag "KPI - Threshold" on to Color so its color which bars are above or below the threshold. 



Step 4: 

Create a running sum of weeks over the threshold.

Calculation checks if the sum is above the threshold, add one to the running total. This will also restart the running total when a number that is below the threshold is present. 


Step 5:  Create a calculation that says if the running sum of weeks is greater than 0 and the next bar is equal to 0, return the number.



This will show the running total if the number is the last occurrence, but otherwise will show nothing. 


Step 6:

 Finally Drag "running weeks to Label" and test the visualization.



Thanks Guru's,
Prazval.ks

 








DAX Time Intelligence Functions

   Thanks Guru's, Prazval.Ks