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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
TimmK
Helper IV
Helper IV

Rolling Monthly Average

I want to calculate the rolling average of the last 12 months while the current month should be excluded.

 

There should be two variants:

  • Variant 1: Divisor is 12
  • Variant 2: From the last 12 months (excluding current month) the number of months where consumption is greater than 0 should be used as the divisor

In addition, I want to create a bar chart that shows the last 12 months (+ current month) WITH months where consumption is 0.

 

The problem is that in months without consumption the value is empty.

 

Bar Chart 1 is what I get (months with no consumption are missing).

Bar Chart 2 within the yellow rectangle is what I want (within last 12 months + current month; showing also months with no consumption; but it should not show months of the future or prior last 12 months)

 

Example table

Table Example.PNG

Table I want to have in my report view

Table.PNG

Bar Chart 1

Bar Chart.PNG

Bar Chart 2

Bar Chart 2.PNG

1 REPLY 1
amitchandak
Super User
Super User

@TimmK , the expected output is not very clear.

 

With help from date table a formula like this example

 

Rolling 12 = divide( CALCULATE(sum(Sales[Sales]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date]),-12,MONTH)) ,
CALCULATE(distinctCOUNT('Date'[Month Year]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-12,MONTH), filter(Sales,not(isblank(sum(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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.