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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Del235
Helper II
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
Ajendra
Resolver I
Resolver I

Hi @Del235

 

Query = TOTALYTD([Total Sale],
DateMaster[Date],
DateMaster[Date]<TODAY())
 
Check below Screen Shot of Output.
SS.JPG

 

View solution in original post

3 REPLIES 3
Ajendra
Resolver I
Resolver I

Hi @Del235

 

Query = TOTALYTD([Total Sale],
DateMaster[Date],
DateMaster[Date]<TODAY())
 
Check below Screen Shot of Output.
SS.JPG

 

FreemanZ
Super User
Super User

or like:

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

hi @Del235 

try like:

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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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