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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Jaycena2024
Frequent Visitor

Year over Year Percentage calculation in stacked bar chart

Hi,
I have the below stacked bar chart with running total counts of different markets. I am looking to calculate year over year percentage in their growth for each of markets as per the legend.
For example: I want to show the % change in Finance from 2 in 2022 to 10 in 2024 (400%) and similar for other categories also i.e., hr, marketing and supply chain in the same visual
yoy growth.png

2 REPLIES 2
amitchandak
Super User
Super User

@Jaycena2024 , Asumming year is part of Dim Year or date, first of all have measure like

 

//Only year vs Year, not a level below

This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])

 

You can use diff or diff%. Use new label property Details and add it there

 

New Power BI Data Label Customizations (December 2023) - Enhance Your Data Analysis & Reporting:
https://www.youtube.com/watch?v=qe3eW4OkAN8&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I have a date column (date in format dd mmm yyyy)
The values in the above graph is coming from a running total quick measure

Count of Markets running total in Year =
CALCULATE(
    COUNTA('Sheet1'[Markets]),
    FILTER(
        ALLSELECTED('Sheet1'[Date].[Year]),
        ISONORAFTER('Sheet1'[Date].[Year], MAX('Sheet1'[Date].[Year]), DESC)
    )
)

Now I want to include % change from the running total measure. Can you provide a measure which I can use here

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!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!