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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ZakharyMG
New Member

How to get an average for the previous 12 months dynamically

Evening gentlemen, 

I have this problem and I am not sure how to approach it. I have a table full of consumer complaints for our company, ofcourse the consumer complaint has a submission date. 

One of the ways we weight and average consumer complaints is by the volume produced by our factory. One of these measures is Consumer Complaints per Million units produced. Where this measure for any given month X is the consumer complaints from month X divided by the average units produced in months ranging from X-12 to X-1 (the average of the 12 months/year before)

So for each month I need to calculate the average volume for the 12 months before it. I am unsure how to do this in PowerBi and my knowledge in dax is limited. Currently I have a date dimension table that is just CalendarAuto()  and this is how I bridge between the consumer complaints and the volume produced table, but I can't figure out how to dynamically perserve the 12 months before the month that is selected in the slicer (this is for the volume table only).

Any help would be much appreciated.

1 ACCEPTED SOLUTION
adamc-powerbi
New Member

Hi,

 

Your data table seems fine. You will need a schema like so:

Date 1-to-* complaints table

Date 1-to-* volume product table

 

And then to calculae the 12 month average, look at this article:
https://www.sqlbi.com/articles/rolling-12-months-average-in-dax/

 

 

View solution in original post

1 REPLY 1
adamc-powerbi
New Member

Hi,

 

Your data table seems fine. You will need a schema like so:

Date 1-to-* complaints table

Date 1-to-* volume product table

 

And then to calculae the 12 month average, look at this article:
https://www.sqlbi.com/articles/rolling-12-months-average-in-dax/

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors