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
Anonymous
Not applicable

Year on Year Percentage change

Hi folks,

 

I want to calculate Year on Year % change as per the below table. I want the YoY change to be calculated at the product level.

 

How can I achieve this ? Thanks in advance.

 

 

YearProductTotal Sales
2018Car200
2019Car345
2020Car64
2021Car654
2022Car456
2018Bike125
2019Bike560
2020Bike230
2021Bike238
2022Bike100

 

YearCar SalesYoY % ChangeBike SalesYoY % Change
2018200 125 
2019345 560 
202064 230 
2021654 238 
2022456 100 
2 REPLIES 2
ThxAlot
Super User
Super User

YoY Chg.pbix

 

ThxAlot_0-1692085502355.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



larsheinemann
Frequent Visitor

To calculate the Year on Year (YoY) percentage change for each product, you'd typically calculate the difference in sales between the current year and the previous year, then divide by the sales of the previous year.

 

 

YoY % Change = 
VAR CurrentYearSales = TableName[Total Sales]
VAR PrevYearSales = CALCULATE(
    SUM(TableName[Total Sales]),
    FILTER(
        TableName,
        TableName[Product] = EARLIER(TableName[Product]) && TableName[Year] = EARLIER(TableName[Year]) - 1
    )
)
RETURN
IF(
    ISBLANK(PrevYearSales) || PrevYearSales = 0, 
    BLANK(), 
    (CurrentYearSales - PrevYearSales) / PrevYearSales
)

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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