Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello everyone
Below is the dataset that I have and i would like to calculte the running total. I have see older posts requesting similar calculation but I was not able to make it work. Is someone able to provide me with the dax function.
Thanks
Solved! Go to Solution.
@Anonymous I am thinking something like below. 'Dates'[Date] would reference your date or calendar table which I am assuming is what you are using for your axis.
Spent Running Total =
VAR __MonthSeq = MAX('Monthly By Project Size'[Month Seq])
RETURN
CALCULATE(SUM('Monthly By Project Size'[Total Spent in USD]),FILTER(ALL('Monthly By Project Size'),'Monthly By Project Size'[Month Seq] <= __MonthSeq) && 'Dates'[Date] < __MonthSeq)
Hi,
Share the link from where i can download your PBI file. Please also show the expected result there.
Thanks Ashish, unfortunately I can not share the file outside my organization
Tx
Fanis
@Anonymous So that should be something along the lines of:
Spent Running Total Measure =
VAR __MonthSeq = MAX('Table'[Month Seq]
RETURN
SUMX(FILTER(ALL('Table'),[Month Seq] <= __MonthSeq),[Total Spent in USD])
or:
Spent Running Total Measure =
VAR __MonthSeq = MAX('Table'[Month Seq]
RETURN
CALCULATE(SUM([Total Spent in USD]),FILTER(ALL('Table'),[Month Seq] <= __MonthSeq))
Thanks Creg
In both formulas i am getting the error that the RETURN is incorrect
The syntax for 'RETURN' is incorrect. (DAX(VAR __MonthSeq = MAX('Monthly By Project Size'[Month Seq]RETURN SUMX(FILTER(ALL('Monthly By Project Size'),'Monthly By Project Size'[Month Seq] <= __MonthSeq) ,'Monthly By Project Size'[Spent
@Anonymous Missing paren:
Spent Running Total Measure =
VAR __MonthSeq = MAX('Table'[Month Seq])
RETURN
SUMX(FILTER(ALL('Table'),[Month Seq] <= __MonthSeq),[Total Spent in USD])
or:
Spent Running Total Measure =
VAR __MonthSeq = MAX('Table'[Month Seq])
RETURN
CALCULATE(SUM([Total Spent in USD]),FILTER(ALL('Table'),[Month Seq] <= __MonthSeq))
Brilliant thanks a lot,
One last touch if you dont mind please. Can we some how show nopthing for the future months? The first line chart i have used your dax in the second chart I have done the same in my excel source, can we make the chart using the dax look like the one from excel?
@Anonymous I am thinking something like below. 'Dates'[Date] would reference your date or calendar table which I am assuming is what you are using for your axis.
Spent Running Total =
VAR __MonthSeq = MAX('Monthly By Project Size'[Month Seq])
RETURN
CALCULATE(SUM('Monthly By Project Size'[Total Spent in USD]),FILTER(ALL('Monthly By Project Size'),'Monthly By Project Size'[Month Seq] <= __MonthSeq) && 'Dates'[Date] < __MonthSeq)
Check out the April 2026 Power BI update to learn about new features.
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.
| User | Count |
|---|---|
| 41 | |
| 37 | |
| 34 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 62 | |
| 31 | |
| 26 | |
| 25 |