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! Learn more

Reply
swisdom
Helper I
Helper I

Moving average of a calculated measure

I'm trying to create a rolling/moving average of a measure that is being calculated elsewhere.

swisdom_1-1637362763934.png

This is a matrix I have set up of the items in question. The first column Shipped Count is a count (from one table), Direct_Hrs is just a sum (from a second table), and UnitsPerHour is calculated by dividing the two. The date is from a Date Table.

 

UnitsPerHour = 
Divide('Table1'[Shipped Count], [Direct_Hrs])

 

I would like to create a moving average of the previous 6 months UnitsPerHour. I've tried a few different calculations but can't get it to work. I could do it in Excel pretty easily but I can't figure out DAX coding to do it. Any advice?

 

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Please share the PBI file and also show the expected result very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Alright, I created a quick and dirty sample dataset to show what my report is doing.

Here is a link to the PBI file 

Basically, what I want to do is create a moving/rolling average of the UnitsPerHour column. I made a mock-up in Excel to show what I mean:

swisdom_2-1637678878021.pngswisdom_3-1637678890304.png

 

Units Per Hour is a calculated measure based on the two tables in the report.

UnitsPerHour = 
Divide(RMA[Shipped Count], SUM(Labor[Labor Hrs]))

 

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

That works perfectly thank you! So simple haha

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors