Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have used the quick measure to calculate a 12 month rolling average for my data. This all works fine. However, PowerBI appears to have forecast the rolling average past my last data point. So the last data point I have in the time series is February 2019, but the rolling average has been calculated until December 2019.
Can anyone tell me how PowerBI is calculating these extra values? and why it is calculating them? and how to stop it?
I've tried working it out from the DAX and got nowhere!
Solved! Go to Solution.
Hi @k-m-l
Create measures as below
total = SUM(Sheet5[value]) calendar date = MAX('calendar'[Date]) true/flase = VAR lastpoint = CALCULATE ( MAX ( Sheet5[date] ), ALL ( Sheet5 ) ) RETURN YEAR ( [calendar date] ) < YEAR ( lastpoint ) || ( YEAR ( [calendar date] ) = YEAR ( lastpoint ) && MONTH ( [calendar date] ) <= MONTH ( lastpoint ) ) rolling sum 12 = IF([true/flase]=TRUE(), VAR __LAST_DATE = ENDOFMONTH('calendar'[Date].[Date]) VAR __DATE_PERIOD = DATESBETWEEN( 'calendar'[Date].[Date], STARTOFMONTH(DATEADD(__LAST_DATE, -11, MONTH)), ENDOFMONTH(DATEADD(__LAST_DATE, 0, MONTH)) ) RETURN SUMX( CALCULATETABLE( SUMMARIZE( VALUES('calendar'), 'calendar'[Date].[Year], 'calendar'[Date].[QuarterNo], 'calendar'[Date].[Quarter], 'calendar'[Date].[MonthNo], 'calendar'[Date].[Month] ), __DATE_PERIOD ), CALCULATE([total], ALL('calendar'[Date].[Day])) )) rolling average 12 = [rolling sum 12]/12
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @k-m-l
Is this problem sloved?
If it is sloved, could you kindly accept it as a solution to close this case?
If not, please let me know.
Best Regards
Maggie
Hi @k-m-l
Create measures as below
total = SUM(Sheet5[value]) calendar date = MAX('calendar'[Date]) true/flase = VAR lastpoint = CALCULATE ( MAX ( Sheet5[date] ), ALL ( Sheet5 ) ) RETURN YEAR ( [calendar date] ) < YEAR ( lastpoint ) || ( YEAR ( [calendar date] ) = YEAR ( lastpoint ) && MONTH ( [calendar date] ) <= MONTH ( lastpoint ) ) rolling sum 12 = IF([true/flase]=TRUE(), VAR __LAST_DATE = ENDOFMONTH('calendar'[Date].[Date]) VAR __DATE_PERIOD = DATESBETWEEN( 'calendar'[Date].[Date], STARTOFMONTH(DATEADD(__LAST_DATE, -11, MONTH)), ENDOFMONTH(DATEADD(__LAST_DATE, 0, MONTH)) ) RETURN SUMX( CALCULATETABLE( SUMMARIZE( VALUES('calendar'), 'calendar'[Date].[Year], 'calendar'[Date].[QuarterNo], 'calendar'[Date].[Quarter], 'calendar'[Date].[MonthNo], 'calendar'[Date].[Month] ), __DATE_PERIOD ), CALCULATE([total], ALL('calendar'[Date].[Day])) )) rolling average 12 = [rolling sum 12]/12
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Tried this and this didn't seem to work for me.
can you post the dax formula
Proud to be a Super User!
It's just the DAX that is generated using the quick measure. I haven't changed it at all.
ALL _Total rolling average =
IF( ISFILTERED('Date'[Cal_Date]),
ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
VAR __LAST_DATE = ENDOFMONTH('Date'[Cal_Date].[Date])
VAR __DATE_PERIOD = DATESBETWEEN( 'Date'[Cal_Date].[Date], STARTOFMONTH(DATEADD(__LAST_DATE, -11, MONTH)), __LAST_DATE )
RETURN AVERAGEX(
CALCULATETABLE(
SUMMARIZE(
VALUES('Date'), 'Date'[Cal_Date].[Year], 'Date'[Cal_Date].[QuarterNo], 'Date'[Cal_Date].[Quarter], 'Date'[Cal_Date].[MonthNo], 'Date'[Cal_Date].[Month] ), __DATE_PERIOD ),
CALCULATE([ALL _Total], ALL('Date'[Cal_Date].[Day])) ) )
I have the same exact issue. I am using the quick measures but for some reason, it shows data 12 months past the current month.
User | Count |
---|---|
92 | |
85 | |
77 | |
66 | |
62 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
59 |