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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Chanleakna123
Post Prodigy
Post Prodigy

Calculate MTD,

Hi , I'm very struggling on calculated the data using MTD performance, 
i would like to compared MTD in monthly to see the real performance. 
What i'm having right now is always showing MTD data vs. Whole month last year , which is not right as expected. 

can you share me the right formula ? 
ie. From 01st Jan to 21st Jan 2024 vs.  01st Jan to 21st Jan 2023

 

Thank 

8 REPLIES 8
Daniel29195
Super User
Super User

hello @Chanleakna123 

you can use this measure : 

 

Measure 9 =
CALCULATE(
    [Revenue],
    SAMEPERIODLASTYEAR(DATESMTD('Date Table'[Date]))
)

 

or you can use : 

Measure 9 =
CALCULATE(
    [Revenue],
    dateadd(DATESMTD('Date Table'[Date]),-1,YEAR)
)

 

 

 

let me know if it works for you .

 

 

 

 

If my response has successfully addressed your issue kindly consider marking it as an accepted solution! This will help others find it quickly. Dont forget to hit thumbs up buttton 👍

 

it's accumulated each other , which is not right 

 

 

Screenshot 2024-01-22 150104.png

@Chanleakna123 

if you want the same day last year, 

then modify the measures to this : 

Measure 9 =
CALCULATE(
    [Revenue],
    dateadd('Date Table'[Date],-1,Month)
)

 

or you can use : 

Measure 9 =
CALCULATE(
    [Revenue],
    dateadd('Date Table'[Date],-1,YEAR)
)

 

 

let me know if this works for you . 

 

if it still doesnt work,  plesae share a sample of your pbix file to take a closer look . 

 

best regards,

Fowmy
Super User
Super User

@Chanleakna123 

Follow the same pattern as per this formula:

MoM = 

VAR __CM = [Sales Amount]
VAR __Period = DATEADD( DATESBETWEEN( 'Date'[Date] , MIN( 'Date'[Date] ) , MAX( 'Sales'[Order Date] ) ) , -1 , YEAR )
VAR __LYSM = CALCULATE( [Sales Amount] ,__Period )
RETURN
  __CM -  __LYSM



Fowmy_0-1705905660895.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Not reflect to what i need , 

when i do this calculate , it show my MTD is in Negative . 
i may need MTD this year vs. MTD last year , with the same period day 

@Chanleakna123 

This is what exactly the formula that I shared does, 
Sharing a dummy Power BI file representing your scenario would be beneficial. You can save the Power BI file on Google Drive or any other cloud storage platform and provide the link here. Kindly ensure that permission is granted to open the file.




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

MTD.png

you can check on the MOM forlmula , seems like not as needed. 
i would like to have the same period in Last year to be shown next to it. 

@Chanleakna123 

Without looking at your data model, the exisitng measures and how you are trying to implmenet this measure, it's hard to suggest a solution. Create a small Power BI file representing you scenario and share it using google drive or any other sharing option.


Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.