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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.