Hello @JazZ0003,
Thank You for posting your query onto the Forum.
In order to achieve the results based on the scenario that you’ve specified. I’m not sure results can be achieved based on the measures itself. I added a calculated column which helps in calculating the “Cumulative/Running Totals Ignoring The Blanks”. This column does the ranking of the Date field which is there inside the SampleData (Fact Table) and then this “Ranking” column can be passed on inside the measure as a reference.
So below are the steps mentioned to achieve the results -
1). Create a calculated column which does the Ranking of the Dates ignoring the Blank rows -
Ranking =
VAR _Current_Date = SampleData[Date]
RETURN
CALCULATE( RANK.EQ( _Current_Date , SampleData[Date] , ASC ) ,
ALL( SampleData ) ,
SampleData[Value] <> BLANK() )
2). Create a measure which evaluates the SUM of results of Last 4 Days Running Totals -
4 Days Rolling Sum - Harsh =
IF( ( SELECTEDVALUE( SampleData[Ranking] ) - 4 ) >= 0 ,
CALCULATE( SUM( SampleData[Value] ) ,
FILTER( ALLSELECTED( SampleData ) ,
SampleData[Ranking] > MAX( SampleData[Ranking] ) - 4 &&
SampleData[Ranking] <= MAX( SampleData[Ranking] ) ) ) ,
BLANK() )
3). Create a measure which evaluates the AVERAGE of results of Last 4 Days Running Totals -
4 Days Rolling Averages - Harsh =
DIVIDE( [4 Days Rolling Sum - Harsh] , 4 , 0 )
Below is the screenshot of the final results provided for the reference -
I’m also attaching the working of the PBIX file for the reference purposes.
Hoping you find this useful and meets your requirements that you’ve been looking for.
Note: Even after adding a calculated column, the size of the file is still small in comparison to the file which you have uploaded.
Thanks and Warm Regards,
Harsh
Rolling Sum and Average Ignoring Blanks - Harsh.pbix (67.1 KB)