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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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