Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
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!
@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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
75 | |
63 | |
51 | |
48 |
User | Count |
---|---|
204 | |
86 | |
64 | |
59 | |
56 |