Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Dear Community, I am confronted with the following situation:
Context:
I want to create a graph that shows the evolution of my sales over the last 12 months (Trailing Twelve months - TTM) BUT where each month is already the sum of the last 12 months (Moving Annul Total - MAT). And I'd like this view to change according to a time slicer. For example, if I choose the month of May 23, I should see:
Problem:
My problem is that the graph doesn't follow the time slicer at all. When I put a month in my slicer, the graph gives me a single value for the last 30 days, whereas I'd like to see the last 12 months.
This is what I've done:
Sales_MAT = CALCULATE(
sum(Sales[Sales]),DATESINPERIOD('Date Dimension'[DateDimension],
MAX('Date Dimension'[DateDimension]),-12,MONTH) )
TTM_Total_Sales =
VAR CurrentDate = MAX('Date Dimension'[DateDimension])
VAR PreviousDate = DATE(YEAR(CurrentDate),MONTH(CurrentDate)-12,DAY(CurrentDate))
VAR Result =
CALCULATE(
Sales[Sales_MAT],
FILTER(
ALL('Date Dimension'[DateDimension]),
'Date Dimension'[DateDimension]>=PreviousDate && 'Date Dimension'[DateDimension]<=CurrentDate
)
)
RETURN
Result
And I don't understand what else I need to do....
Already thank you for your help !
For those who prefer to work with the full file, you can download it here (through "We transfer"): https://we.tl/t-xDys0zqAHG
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
69 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
88 | |
49 | |
45 | |
38 | |
37 |