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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Prevent Samepriodlastyear from propagating?

I have the below measures:

 

 

Revenue YTD := CALCULATE([Revenue] , DATESYTD('Date'[Date] ,"31/05" ))



Revenue LYTD:=CALCULATE( [Revenue YTD],  SAMEPERIODLASTYEAR('Date'[Date]))

 

 

The first one works fine, I would like to modify the second... I would like the SAMEPERIODLASTYEAR('Date'[Date])) to work as it is (that is, bringing the dates for last year), but I want that only to affect Revenue and nothing else.

 

 

(I have another dimension that is connected to date, and the SAMEPERIODLASTYEAR('Date'[Date)) brings the values from last year in that dimension which I don't want...)

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Try like

 

Last YTD Sales = CALCULATE([Revenue] ,DATESYTD(dateadd('Date'[Date],-1,Year),"5/31"))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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