Skip to main content
cancel
Showing results for 
Search instead 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

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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