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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Need to measure last year and this year until yesterday

So quite new at this but need to calculate this year against last year until yesterday. Because I get data only once a night. So the data I have today is for yesterday.

 

Now it shows data for yesterday lets say 300 000euros and it is 01.01.2019-23.04.2019 and the target goal is sameperiod lastyear and it shows 305 000euros but it is for 01.01.2018-24.04.2018 so it shows as -1,66%

 

In this instance i use KPI slicer and my measures are Indicator : 

Total Euros MTD = IF( LASTDATE( Dates[Date] ) > TODAY(), BLANK(), CALCULATE( [Total Euros], DATESMTD( Dates[Date])))
target goal : 
Total Euros MTD LY =
IF( LASTDATE( Dates[Date] ) > TODAY(),
BLANK(),
CALCULATE( [Total Euros LY], DATESMTD( Dates[Date])))
2 REPLIES 2
verscev
Frequent Visitor

Hello @Anonymous ,

 

When calculating ou MTD LY, try using the SAMEPERIODLASTYEAR function.

 

First calculate you MTD of the current period, which will take into account that no data is available for today, and then move the period to last year with the SAMEPERIODLASTYEAR function.

 

Evi

 

 

Anonymous
Not applicable

Hello,

 

Have tried this different ways

Total Euros MTD = if( lastdate( Dates[Date] ) > today(); blank(); calculate( [Total Euros]; Datesmtd( dates[date])))
Total Euros MTD LY = CALCULATE(TOTALMTD(SUM(wl_cargo[EURSEK]); Dates[Date]); SAMEPERIOdLASTYEAR(Dates[Date]))
 
But it still shows the whole month for last year.
 
Any other ideas? Can I filter the ly for today -366?
 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.