Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hey guys, I'm new to powerBI and I can't figure out the solution to my problem. The probem is the Line chart X axis that is MonthYear is showing the separate amounts of each month, instead of the total. What I want to do is like this in excel.Excel LTM total displayed over 12 months
The excel above is always showing the total of last 12 months. So the total in January 2020 was like this over 12 months, and we see the total of the last 12 months from December was a little less, and so on.
Right now I want to show the total that is in the card at the Jan-2020, and below I am showing the total from December 2019 which is a little less. And I want to display this in the X axis line chart, just like in excel.
The measure I am using to get the 12 months sum is this:
Solved! Go to Solution.
You can use a relative date filter for that
https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range
Or do the same in visual level filter
You can use a relative date filter for that
https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range
Or do the same in visual level filter
Or try one of the three
12 month =
CALCULATE(SUM('Monthly Collection Report PBI'[Debit credit value])
, DATESBETWEEN('Date'[Date], Min(dateadd('Date'[Date],-12,month)), MAX('Date'[Date])))
12 month =
var _min = Minx(allselected('Date'),dateadd('Date'[Date],-12,month))
var _max = Minx(allselected('Date'),'Date'[Date])
CALCULATE(SUM('Monthly Collection Report PBI'[Debit credit value])
, DATESBETWEEN('Date'[Date],_min , _max))
12 month =
var _min = Minx(allselected('Date'),dateadd('Date'[Date],-12,month))
var _max = Minx(allselected('Date'),'Date'[Date])
CALCULATE(SUM('Monthly Collection Report PBI'[Debit credit value])
, filter(all('Date'),'Date'[Date]>=_min && 'Date'[Date]<= _max))
Sadly relative slicer and these measures did not produce the result I need. I keep getting the same thing.
The line showing separate values through the months that add up to the total, instead of showing 12 totals
https://drive.google.com/open?id=1h4ewmgy2oVf24c45GPEGKH58agIyZp0m
Attached a pbix file with dummy data I tried to replicate. Try clicking through the months from january 2020 till may 2019 or something like that and watch how the total is displayed in the line. What I want is that when you click on jan 2020 slicer, it will display the total, but also display the total for the rest of the 12 months in the X Axis. So the end result should be a line displaying all 12 total months back, depending on which month you select in the slicer.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!