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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
OAM
Frequent Visitor

Bar chart of YoY percent change calculated from monthly percentages

I have the following data in Tab1:

 

MonthK_Penetration
2021-0231%
2021-0329%
2021-0428%
2022-0242%
2022-0342%
2022-0441%

 

And I also have a Calendar table which contains all the months in my Tab1.

 

I want to graph the YoY percentage change, to show how much growth there's been between 2021 and 2022 monthly. 

 

So the output should be a graph based on this table, using the formula per month, eg. for April --> (CurYear - PrevYear) / PrevYear:

MonthYoY % Change
020.35%
030.44%
040.46%
1 ACCEPTED SOLUTION
SpartaBI
Community Champion
Community Champion

@OAM missing some info about your model.
Do you have a proper date table or just a table with the months you showed from Tab1.
Is your month a text column or a date formatted as month?
Anyway, I created this dim table (it's not really a calendar, but maybe that is what you have):
In my case the month was a date so it got the 1st of every month:

SpartaBI_0-1653569726514.png

Then, I connected it to tab 1 like this: Calendar[Date] -> Tab1[Month]

SpartaBI_1-1653569841391.png


Then, created this measure:

 

YOY % Change = 
VAR _current_year = CALCULATE(SUM(Tab1[K_Penetration]),'Calendar'[Year] = 2022)
VAR _prev_year = CALCULATE(SUM(Tab1[K_Penetration]),'Calendar'[Year] = 2021)
VAR _result = 
    DIVIDE(_current_year, _prev_year ) - 1
RETURN
    _result

 


And got this:

SpartaBI_2-1653569891558.png


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png

Showcase Report – Contoso By SpartaBI


SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Full-Logo11.png

View solution in original post

3 REPLIES 3
SpartaBI
Community Champion
Community Champion

@OAM missing some info about your model.
Do you have a proper date table or just a table with the months you showed from Tab1.
Is your month a text column or a date formatted as month?
Anyway, I created this dim table (it's not really a calendar, but maybe that is what you have):
In my case the month was a date so it got the 1st of every month:

SpartaBI_0-1653569726514.png

Then, I connected it to tab 1 like this: Calendar[Date] -> Tab1[Month]

SpartaBI_1-1653569841391.png


Then, created this measure:

 

YOY % Change = 
VAR _current_year = CALCULATE(SUM(Tab1[K_Penetration]),'Calendar'[Year] = 2022)
VAR _prev_year = CALCULATE(SUM(Tab1[K_Penetration]),'Calendar'[Year] = 2021)
VAR _result = 
    DIVIDE(_current_year, _prev_year ) - 1
RETURN
    _result

 


And got this:

SpartaBI_2-1653569891558.png


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png

Showcase Report – Contoso By SpartaBI


SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Full-Logo11.png

OAM
Frequent Visitor

Yes this is exactly what I wanted - it worked great! Thanks!!

SpartaBI
Community Champion
Community Champion

@OAMmy pleasure 🙂
Hey, check out my showcase report:
https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543
Give it a thumbs up if you liked it 🙂

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.