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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Zarlot531
Helper V
Helper V

Can't get Moving Average (or sum) to work right

This is a really a simple question. Every formula I find here and elsewhere, I plug into a "moving average" column and it never produces an average. In the example below, I'm just trying to even get a sum, but I can't even get this. It simply shows what is in the column data. This data is week-end (Sunday) times. Any ideas how to get this to work? Thanks. 

 

Capture336.JPG 

1 ACCEPTED SOLUTION

Thank you for your help. I wasn't able to get this to work in Power BI interface, so I just did it at the SQL Server level. Capture999.JPG

View solution in original post

6 REPLIES 6
JulietZhu
Helper IV
Helper IV

You need create new measure from report. Not new column from data. I checked my data, this measuere is not shown in the table data at all.

 

Right click your table, you will see add new measure and put your DAX. It will work. Good luck.

 

2.PNG

JulietZhu
Helper IV
Helper IV

Is Your column  calcuated average or sum?  Actually it calcualte sum. To get average, you need divide 30 days.

Put my formula for your reference. It works for me2.PNG

The problem is you'll see I have the same formula as you produced except for the /30. I was trying to get the sum to work before I moved on the average and it won't even do that. I probably just need to figure out how to do this at the sql server level. Probably much simpler. 

kcantor
Community Champion
Community Champion

@Zarlot531

The moving average I use is meant to be a measure and displayed in a visual. If you make it as a column it is averaging that specific row. Create it as a measure and use your weeks on your axis.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Well part of the reason I'm using the actual end-of-week dates is because it wouldn't sort properly, even with a sort column. 

 

I have played around with the "measure" thing. Looks interesting but still no luck, will continue to play. Thanks

Thank you for your help. I wasn't able to get this to work in Power BI interface, so I just did it at the SQL Server level. Capture999.JPG

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.