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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Mohanad-Mustafa
Advocate III
Advocate III

Calculating year over year change in % for MTD Sales

Hi Team,

 

I have created these three forumlas to calculate my MTD for 2021,2020 and 2019 respectively and they work well. 

I have used all these filters because my calendar table is a bit complicated. 

 

MTD 2021 = CALCULATE(SUM(Sales[Total Sales]), FILTER('Calendar','Calendar'[Date] >= DATE(YEAR(TODAY()), MONTH(TODAY()), 01)), FILTER('Calendar', 'Calendar'[Date] < TODAY()-1))
 
MTD 2020 = CALCULATE ( SUM ( Sales[Total Sales] ), FILTER ( 'Calendar', 'Calendar'[Date] >= DATE ( YEAR ( TODAY () ) - 1, MONTH ( TODAY () ), 01 ) ), FILTER ( 'Calendar', 'Calendar'[Date] < DATE ( YEAR ( TODAY () ) -1, MONTH ( TODAY () ), DAY ( TODAY () ) ) ) )
 
MTD 2019 = CALCULATE ( SUM ( Sales[Total Sales] ), FILTER ( 'Calendar', 'Calendar'[Date] >= DATE ( YEAR ( TODAY () ) - 2, MONTH ( TODAY () ), 01 ) ), FILTER ( 'Calendar', 'Calendar'[Date] < DATE ( YEAR ( TODAY () ) -2, MONTH ( TODAY () ), DAY ( TODAY () ) ) ) )

 

Now I need to calculate the change for percentage between the MTD measures for the three years.

 

Is there a way to do this?

 

Thanks

 

Mohanad

1 ACCEPTED SOLUTION

Thanks @amitchandak , I found another solution to calculate MTD year over year percentage. 

 

Solution is: 

MTD Change%(2020/2021) = ([MTD 2021]-[MTD 2020])/[MTD 2020]

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Mohanad-Mustafa , with help from datesmtd

 

measures example

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))

last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))

last to last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-24 ,MONTH)))

 

 

refer if needed

Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA

Thanks @amitchandak , I found another solution to calculate MTD year over year percentage. 

 

Solution is: 

MTD Change%(2020/2021) = ([MTD 2021]-[MTD 2020])/[MTD 2020]

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.