Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
Hi,
I have a montly report where all data is filtered by a Slicer (e.g. 2024-12).
I have a measure that calculate Rolling 12M sales which for 2024-12 summarize Total sales for 2024-01 to 2024-12.
In this montly report I want to have a line chart that shows Rolling 12M per months the last 12 months which in above example show X-axis from 2024-01 to 2024-12 where 2024-01 summarizes sales from 2023-02 to 2024-01 (Rolling 12 at 2024-01)
Today, I try to use below DAX but this will only give me the value of 2024-12
Anyone that could support?
Solved! Go to Solution.
Hello @Anonymous ,
Could you try this please?
Last12MonthsSales =
VAR CurrentDate = MAX('Date'[Date]) -- Get the current date in the context of the chart
RETURN
CALCULATE(
[Total Sales],
DATESINPERIOD('Date'[Date], CurrentDate, -12, MONTH) -- Rolling 12 months from each point on the X-axis
)
@Anonymous
It seems you need to be able to select a particular month and a chart to show past number of months, 12 in your case, check this video out: https://youtu.be/d8Rm7dwM6gc
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Anonymous
It seems you need to be able to select a particular month and a chart to show past number of months, 12 in your case, check this video out: https://youtu.be/d8Rm7dwM6gc
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hello @Anonymous ,
Could you try this please?
Last12MonthsSales =
VAR CurrentDate = MAX('Date'[Date]) -- Get the current date in the context of the chart
RETURN
CALCULATE(
[Total Sales],
DATESINPERIOD('Date'[Date], CurrentDate, -12, MONTH) -- Rolling 12 months from each point on the X-axis
)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 56 | |
| 47 | |
| 44 | |
| 20 | |
| 20 |
| User | Count |
|---|---|
| 72 | |
| 70 | |
| 34 | |
| 33 | |
| 31 |