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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MidtownMo
Helper I
Helper I

How to calculate YTD LY -1 day?

Hi.  I have the following measure to calculate the number of customers YTD LY...

 

Customer Count YTD LY =
TOTALYTD([Customer Count], DATEADD('Date_Calendar'[Date],-1,YEAR), ALL(Date_Calendar))
 
My challenge is that when comparing YTD to YTD LY, since my data is updated overnight, when I look at data today I am always looking at one additional day last year.  For example, if today is Sep. 8, my YTD data is thru 9/7 but the YTD LY data is thru 9/8.  I want to adjust the YTD LY measure to essentially provide "year to date last year minus one day" and am seeking the community's help.  Thanks in advance!
1 ACCEPTED SOLUTION
PowerUserR
Solution Supplier
Solution Supplier

Hi,

I think you ust use the DATEADD(('Date_Calendar'[Date],-366,DAYS).
However, this could interfear with leap year (If that is a concern).

View solution in original post

2 REPLIES 2
MidtownMo
Helper I
Helper I

Thanks for the prompt response!

PowerUserR
Solution Supplier
Solution Supplier

Hi,

I think you ust use the DATEADD(('Date_Calendar'[Date],-366,DAYS).
However, this could interfear with leap year (If that is a concern).

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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