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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Rosh89
Helper I
Helper I

SAMEPERIODLASTYEAR not working with DATESMTD

Hi, 

 

I have 4 DAX formulas given below. I want all the 4 to show MTD, YTD calculation and not the full month or entire year calculation.

year € and LY YTD revenue work perfectly and show proper year to date calcuation. But month € and LY MTD revenue does not show Month to date calculation and instead it shows calculation for the entire month. What could be wrong with month € and LY MTD revenue field?

 

year € = CALCULATE(SUM('shops'[Revenue]),
DATEADD(FILTER(DATESYTD('Date'[Date]), 'Date'[Date] < TODAY()), 0, YEAR))    -- is correct and calculates year to date


month € = CALCULATE(SUM('shops'[Revenue]),
DATEADD(FILTER(DATESMTD('Date'[Date]), 'Date'[Date] < TODAY()), 0, MONTH))    -- is not correct and I want it to calcuate month to date

 

LY YTD revenue = CALCULATE([year €], SAMEPERIODLASTYEAR('Date'[Date]))   -- is correct and calculates year to date

 

LY MTD revenue = CALCULATE([month €], SAMEPERIODLASTYEAR('Date'[Date]))       -- is not correct and I want it to calcuate month to date

1 REPLY 1
Srivatshan_GR
New Member

Please add sample input images,what you are expecting,what you are getting in output. So it would be easy to add relevant response. 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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