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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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?
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!