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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello everyone,
I found this DAX code to calculate a yearly running total :
Qty Invoiced running total in Month =
CALCULATE(
SUM('Revenue'[Qty Invoiced]),
FILTER(
ALLSELECTED('Revenue'),
'Revenue'[Year] = MAX ( 'Revenue'[Year] ) &&
'Revenue'[Month] <= MAX ( 'Revenue'[Month] )
)
)
I am using the Area chart with the Year in legend to show the yearly difference however my running total stop on the month when I don't have data, to continue on the next one.
Any clue how I could enhance this measure ?
Solved! Go to Solution.
@Anonymous Use date table that will make sure you have data for the month you do not have data
Qty Invoiced running total in Month =
CALCULATE(
SUM('Revenue'[Qty Invoiced]),
FILTER(
ALLSELECTED('Date'),
'Date'[Year] = MAX ( 'Date'[Year] ) &&
'Date'[Month] <= MAX ( 'Date'[Month] )
)
)
to means this seem like YTD only
YTD Sales = CALCULATE(SUM(Revenue[Qty Invoiced]),DATESYTD('Date'[Date],"12/31"))
for runnign total
Qty Invoiced running total in Month =
CALCULATE(
SUM('Revenue'[Qty Invoiced]),
FILTER(
ALLSELECTED('Date'),
'Date'[DAte] <= MAX ( 'Date'[Date] )
)
)
@Anonymous Use date table that will make sure you have data for the month you do not have data
Qty Invoiced running total in Month =
CALCULATE(
SUM('Revenue'[Qty Invoiced]),
FILTER(
ALLSELECTED('Date'),
'Date'[Year] = MAX ( 'Date'[Year] ) &&
'Date'[Month] <= MAX ( 'Date'[Month] )
)
)
to means this seem like YTD only
YTD Sales = CALCULATE(SUM(Revenue[Qty Invoiced]),DATESYTD('Date'[Date],"12/31"))
for runnign total
Qty Invoiced running total in Month =
CALCULATE(
SUM('Revenue'[Qty Invoiced]),
FILTER(
ALLSELECTED('Date'),
'Date'[DAte] <= MAX ( 'Date'[Date] )
)
)
Hi Amit,
Thanks for the inputs.
I created a date table following this procedure , however whether I write one of the two codes you mentionned my output is incorrect:
Am I missing something ?
@Anonymous , hope axis is also coming from date table also check formula, seems like only allselected and = max is mising
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 53 | |
| 48 | |
| 38 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 93 | |
| 79 | |
| 37 | |
| 27 | |
| 25 |