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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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