Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap
Hi,
I am looking for a DAX measure which can show me 12 month avg for previous 12 months as a constant line on bar chart. As shown below.
Thanks in advance
Solved! Go to Solution.
Hi @MK85 ,
Thanks for the reply from @Greg_Deckler .
First, create a disconnected date table:
Date = VALUES('Table'[Date])
Apply this disconnected table as a slicer.
Create a measure:
12-Month Average =
CALCULATE(
AVERAGE('Table'[Value]),
DATESINPERIOD('Table'[Date], SELECTEDVALUE('Date'[Date]), -12, MONTH)
)
Set up the chart as follows:
The final page effect is as follows:
pbix file is attached.
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi @MK85 ,
Thanks for the reply from @Greg_Deckler .
First, create a disconnected date table:
Date = VALUES('Table'[Date])
Apply this disconnected table as a slicer.
Create a measure:
12-Month Average =
CALCULATE(
AVERAGE('Table'[Value]),
DATESINPERIOD('Table'[Date], SELECTEDVALUE('Date'[Date]), -12, MONTH)
)
Set up the chart as follows:
The final page effect is as follows:
pbix file is attached.
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
It works. Many thanks @Anonymous
@MK85 (3) Better Rolling Average - Microsoft Fabric Community
It doesn't work for as I have dates on x-axis from date table and my context is changing every month, which gives me variable avg for each month.
User | Count |
---|---|
88 | |
74 | |
69 | |
59 | |
56 |
User | Count |
---|---|
40 | |
38 | |
34 | |
32 | |
28 |