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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Anonymous
Not applicable

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!

Anonymous
Not applicable

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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