Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
In my data model I have a total capacity measure which I show on date level. This is the field "FlexLeveling_1 Total FixedFlex". Basically this sums the columns "Benodigde fixed cap (bruto)" and "Benodigde flex cap (netto)" as you can see in the picture below.
Now I want to show a Rolling Average of "FlexLeveling_1 Total FixedFlex" for every date. This rolling average must look back 4 days back and 4 days forward. So basically it covers 9 days of which the selected date is in the middle.
Example:
Period | FlexLeveling_1 Total FixedFlex | Rolling average | Average over periods |
1 | 11 | ||
2 | 47 | ||
3 | 45 | ||
4 | 44 | ||
5 | 23 | 35,78 | 1 to 9 |
6 | 34 | 35,89 | 2 to 10 |
7 | 50 | 33,78 | 3 to 11 |
8 | 43 | 30,22 | 4 to 12 |
9 | 25 | 28,67 | 5 to 13 |
10 | 12 | 31,00 | 6 to 14 |
11 | 28 | ||
12 | 13 | ||
13 | 30 | ||
14 | 44 |
I am now applying the syntax below but it gives me unexpected results. Who can help me?
Try like examples
Rolling4 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX(Sales[Sales Date]),-4,Day))
Rolling 4 plus 4 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX(Sales[Sales Date])-4,8,Day))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...
Appreciate your Kudos.
I tried to adopt your tips. This is what I did:
The output from 6 Jan onwards should be around 4 or 5.
I also added an explanatory example:
What am I doing wrong?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
12 | |
10 | |
10 | |
9 |