cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper II

## Getting TOTALYTD thru yesterday

I need to get the TotalYTD function to only give cumulative totals thru yesterday.  So if today is 4/17.23 I want to see the cumaltive total thru 4/16/23.  On the next day it would go up 1 and so on.

I have successfully written the DAX to give me a cumulative total how to I get it to stop on yesterday?  Itried the TODAY() function but something isn't right.

As a measure, I used

Measure = TOTALYTD(SUM(Table1[Attendance]),Table1[Visit Date])
1 ACCEPTED SOLUTION
Resolver I

Hi @Del235

Query = TOTALYTD([Total Sale],
DateMaster[Date],
DateMaster[Date]<TODAY())

Check below Screen Shot of Output.

3 REPLIES 3
Resolver I

Hi @Del235

Query = TOTALYTD([Total Sale],
DateMaster[Date],
DateMaster[Date]<TODAY())

Check below Screen Shot of Output.

Super User

or like:

Measure =
CALCULATE(
SUM(Table1[Attendance]),
Table1[Visit Date]>=DATE(YEAR(TODAY()), 1, 1),
Table1[Visit Date]<TODAY()
)
Super User

hi @Del235

try like:

Measure = TOTALYTD(SUM(Table1[Attendance]),Table1[Visit Date]
-
CALCULATE(SUM(Table1[Attendance]),Table1[Visit Date]=TODAY()-1)