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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Tarek78
Frequent Visitor

Year-Over-Year calculation

Hi Everyone,

 

I am completely new to Power Pivot and DAX calculations. I have a simple data model with a date table and a fact table with dates and sales generated per date.

 

Each month, I am generating a report that shows MTD and YTD sales vs Last year for the same period.

 

Is there a DAX formula to show this.

 

Year over year DAX.png

4 REPLIES 4
Tarek78
Frequent Visitor

Thanks! I tried them works fine. 

I also used TotalMTD/TotalYTD and it works perfectly also. 

what's the difference between them? Which one using less resources and size?

hi @Tarek78 

TOTALMTD is simplified form of CALCULATE([], DATESMTD). The later provides more flexibility when we have fiscal years starting not on Jan 1st. 

Tarek78
Frequent Visitor

Thanks !!! I will try this next time and keep you posted. 

 

FreemanZ
Super User
Super User

hi @Tarek78 

you would need some measures with Time Intelligence Functions, like

MTD =
CALCULATE(
SUM(FactTable[Sales]), DATESMTD('calendar'[Date]))
 
LY MTD =
CALCULATE
([MTD], SAMEPERIODLASTYEAR('calendar'[Date]))
 
YTD =
CALCULATE(
SUM(FactTable[Sales]), DATESYTD('calendar'[Date]))
 
LY YTD =
CALCULATE
([YTD], SAMEPERIODLASTYEAR('calendar'[Date]))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors