Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
What would be the syntax for a grand total thru Today? I'm using a date table where I'm using the field Date
Solved! Go to Solution.
Hi @Del235
TOTALYTD creates YTD value for the year in the current context. It will continue to calculate up to the last date in your dates table.
If you want to calculate the YTD value up to today's date equivalent in the past years, try this:
YTD up to today =
VAR _Today =
TODAY ()
VAR _EndDate =
DATE ( MAX ( Dates[Year] ), MONTH ( _Today ), DAY ( _Today ) )
VAR _YrMonthToday =
FORMAT ( TODAY (), "mmdd" )
VAR _Result =
CALCULATE (
SUM ( 'DataTable'[Value] ),
FILTER (
ALL ( Dates ),
Dates[Year] = MAX ( Dates[Year] )
&& Dates[Date] <= MAX ( Dates[Date] )
&& Dates[Date] <= _EndDate
)
)
RETURN
_Result
Hi @Del235
Total Through Today =
CALCULATE(
SUM(Sales[SalesAmount]),
'Date'[Date] <= TODAY()
)
I thought the TOTALYTD would only total for the current year?
Hi @Del235
TOTALYTD creates YTD value for the year in the current context. It will continue to calculate up to the last date in your dates table.
If you want to calculate the YTD value up to today's date equivalent in the past years, try this:
YTD up to today =
VAR _Today =
TODAY ()
VAR _EndDate =
DATE ( MAX ( Dates[Year] ), MONTH ( _Today ), DAY ( _Today ) )
VAR _YrMonthToday =
FORMAT ( TODAY (), "mmdd" )
VAR _Result =
CALCULATE (
SUM ( 'DataTable'[Value] ),
FILTER (
ALL ( Dates ),
Dates[Year] = MAX ( Dates[Year] )
&& Dates[Date] <= MAX ( Dates[Date] )
&& Dates[Date] <= _EndDate
)
)
RETURN
_Result
Measure = TOTALYTD(sum('yourtable'[yourvalue]), 'datetable'[date])
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.