Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi
I want to figure out a moving average of sales in 5 day intervals. want to show the average of sales in the last 5 days for each day. I would then like to use this value in a line chart. Can anyone help me with a DAX formula for this?
Hi @WePowerBI ,
We can use the following measure to meet your requirement:
Measure =
CALCULATE (
AVERAGE ( 'Table'[value] ),
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Date] <= MAX ( 'Table'[Date] )
&& 'Table'[Date]
> MAX ( 'Table'[Date] ) - 5
)
)
Then we can get the result like this,
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
This is what I want to accomplish in Power BI. In my Power BI dataset, I have a date table and a sales table that has a date table associated with the date table. How can I achieve the same thing in Power BI?
Hi @WePowerBI ,
How about the result after you follow the suggestions mentioned in my original post? Please try to unpivot the date column in power query editor if your date is multi columns.
Best regards,
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |