Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Nun
Resolver I
Resolver I

Alternative measure to get the same result of quick measure rolling avg 3m.

Hello,

I am using the quick measure Rolling avg 3 months.

The formula is:

IF(     ISFILTERED('Posting date'[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('Calendar'[Date].[Date])   

  VAR __DATE_PERIOD =         DATESBETWEEN(             'Calendar'[Date].[Date],             STARTOFMONTH(DATEADD(__LAST_DATE, -3, MONTH)),             __LAST_DATE         )     RETURN         AVERAGEX(             CALCULATETABLE(                 SUMMARIZE(                     VALUES('Calendar'),                     'Calendar'[Date].[Year],                     'Calendar'[Date].[QuarterNo],                     'Calendar'[Date].[Quarter],                     'Calendar'[Date].[MonthNo],                     'Calendar'[Date].[Month] ),                 __DATE_PERIOD             ),             

CALCULATE(                 SUM('sales'[Amount]),                 ALL('Calendar'[Date].[Day])             )         ) )

When I export in Excel in Power BI service to analyze, In pivot table fields, using as filter Calendar date and as value the rolling avg 3m I dont see any value.

Thanks!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Nun , You can try with date table like the example given below

Take line level Avg

Rolling 3 = CALCULATE(Average(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-3,MONTH))

 

Take sum and divide by month. Month level Avg

Rolling 3 = divide( CALCULATE(sum(Sales[Sales]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date]),-3,MONTH)) ,
CALCULATE(distinctCOUNT('Date'[Month Year]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-3,MONTH), not(isblank((Sales[Sales])))))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Nun , You can try with date table like the example given below

Take line level Avg

Rolling 3 = CALCULATE(Average(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-3,MONTH))

 

Take sum and divide by month. Month level Avg

Rolling 3 = divide( CALCULATE(sum(Sales[Sales]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date]),-3,MONTH)) ,
CALCULATE(distinctCOUNT('Date'[Month Year]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-3,MONTH), not(isblank((Sales[Sales])))))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

I solved the issue, R at the end of the value is due to the format. Power BI converted, automatically the value in Currency format, when the correct is Decimal number. 

Thanks a lot!

@amitchandak 

I created both the measure you suggested, but I get a value number ending with R. (for example 15879157.9867R) 

Thanks

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.