Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi Guys,
How do I do a running total by row in a measure, columns are months?
Jan Feb Mar
Sales 1000: 3500: 6000
Thanks
Lak
The calculation im trying to do.
So, I would still unpivot your months. What you would want to do would be to create a measure that calculates the current month. You would have another measure that calculates for the months previous and does not include the current month. Then you can just subtract them to get the number you are looking for. So, in psuedo-code it would be something like:
Measure Current Month =
VAR __currentMonth = MONTH(TODAY())
RETURN SUMX(FILTER('Table',[month] = __currentMonth),[Value])
Measure Previous Months =
VAR __currentMonth = MONTH(TODAY())
RETURN SUMX(FILTER('Table',[month] <> __currentMonth),[Value])
Measure Difference = [Measure Current Month] - [Measure Previous Months]
Specifics will vary but that's the general idea. With DAX, you can't think in terms of individual cells and rows, DAX is all about tables and columns.
That didn't work 😞
I get figures for previous month, that are the same figures for current month and nothing at all for previous month.
Sorry, I never saw this, I'll give it a go.
Usually you would unpivot your months and then it is trivial. Is there a reason you can't do it that way?
There's a further calculation i need to make, I need to, calculate all sales up to previous month and subtract the figure with the number in a above row.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 84 | |
| 49 | |
| 38 | |
| 31 | |
| 30 |