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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
MattyH
Frequent Visitor

Calculated Columns - Cumulative Totals problems

Hey Guys

 

Im trying to create YTD totals for daily hours (for people) in a calculated column using DAX. I can do it in M (see running total column) but want to do it in DAX.  I have an IF function added in to create and A or B depending on when i go over 5000 hours.

 

 

1. This DAX gave sort of gave me  YTD but  it doesnt really seem to work on a daily basis when i have multiple ROW hours on the same day  and just gives me the same YTD value. I want a row level YTD.

YTDHoursCC =

CALCULATE (

SUMX (Financials, 'Financials'[Hours] ),

ALL ( 'Financials' ),

DATESYTD ( 'Financials'[Date] )

)

 

2. I then created this DAX  after i added an index but it only gave me the daily hours withour adding them  up.

YTDTotalCC2 =
CALCULATE
(

SUM ( 'Financials'[Hours] ),

FILTER (

ALL ( Financials[Index]),

'Financials'[Index]

<= MAX( 'Financials'[Index])

)

)

 

Can someone educate me please?

 

MattyH_0-1626324546860.png

 

 

 

1 REPLY 1
Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @MattyH ,

Try using these measures for creating Running total:
1. Running total= CALCULATE(SUM(Financial[Hours]), ALLSELECTED(Dates)), Dates< = MAX( Date)))

Or

2. Running total= CALCULATE( SUM( Financial[hours]), FILTER( ALLSELECTED(Dates)), ISONORAFTER( Dates, MAX( Dates)), desc)))

 

 

I hope this helps!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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