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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.