Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

TOTALYTD DAX not summing as a Calculated Column, only as a Measure

I'm trying to create a running total for the year, but the DAX formula TOTALYTD does not appear to be functioning correctly for me. I have this formula as a calculated column

Running YTD = TOTALYTD(SUM(Budget[Estimated Revenue]),Budget[Month])
 
and get this output table:
LinuxFish_0-1678140890987.png

 

The expected result is:

LinuxFish_1-1678140987462.png

 

From what I can find, this DAX expression should function but I only get the same value in my [Running YTD] column as the [Estimated Revenue] even with different DAX expressions which should also calculate the running ytd total

 

For example, I have also tried the same thing using this equation which should be identical:

VAR _Month=

     MAX('Budget'[Month])

Return

    CALCULATE(

        SUM(Budget[Volume Estimate]),

        Budget[Month] <= _Month

) 

 

Another thing I have tried is to use a separate date associated to the [Month] column of this table for the second value of TOTALYTD, but that also gives the same incorrect result.

 

UPDATE: running the CALCULATE or TOTALYTD functions works as a measure, but not as a calculated column. I am trying to create a calculated column to use DAX expressions with Power Pivot in Excel as my end goal, so a calculated column will be more beneficial to me

 

UPDATE 2: I created a measure `Total YTD = TOTALYTD(SUM(Budget[Estimated Revenue]),'Date'[Date])` in Power Bi as well as Excel. The Power Bi measure works as intended, but the Excel one does not sum for some reason. I can ask in a different place for Excel problems if there is a better place for this question, but I don't expect there to be much DAX support outside of Power Bi adjacent places

Power Bi:

LinuxFish_1-1678214230929.png

 

Excel:

LinuxFish_0-1678214188936.png

 

UPDATE 3: Using the correct date field is important on Excel as it is on Power Bi. If anyone finds this and is having a similar issue, make sure you are using the 'Calendar'[Date] and not 'Table'[Date] if you are using 'Calendar'[Date] for the TOTALYTD or similar expression

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

The reason you have shared to write the formula as a calculated column formula does not hold water.  Your calculation should definitely be a measure.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

The reason you have shared to write the formula as a calculated column formula does not hold water.  Your calculation should definitely be a measure.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks for looking at this, I will see if applying this DAX statement as a measure with Power Pivot will help. I am working on this data in Excel, not Power Bi, but asked here because this is the only place I know where I could ask a DAX specific question.

 

As a followup, is there some additional reading I can look at for why this doesn't work as a calculated column and only works as a measure?

 

I was intending on adding filters using EARLIER() once I got the TOTALYTD() calculating correctly, but if using a measure is benificial to what I'm working on I can always work in filter context instead.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.