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

View all the Fabric Data Days sessions on demand. View schedule

Reply
0Experience
Helper III
Helper III

How to show count (percentage) on Pie Chart that related to a Bar Chart

Hello,

I'm presenting data through a combination of a bar chart and two pie charts.

 

Pie Chart 1:

                   i) When all years of the bar chart are selected, it displays the percentage of each category. 

                   ii) When only one year is selected from the bar chart, it reveals the percentage of each category for that specific year. For instance, if 2023 is selected, it shows B 42.97% (42.97%).

 

Pie Chart 2:

                   i) Similarly, when all years of the bar chart are selected, it exhibits the percentage of each category.

                   ii) However, when only one year is chosen from the bar chart, it contrasts the percentage of each category for that year against the overall percentages across all years. For instance, if 2023 is selected, it might show B 55 (18.58%).

 

0Experience_0-1714662689867.png

 

 

Expected Output from Chart 1: When selecting a single year, such as 2023, I anticipate seeing the count of each category along with its corresponding percentage, like B 55 (42.97%).

 

You can get the power bi file from the give link (Google Drive).

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @0Experience ,

 

Add the following measure:

Values Measure = 

IF(ISFILTERED('Table'[Year]), CALCULATE(SUM('Table'[Count]) , 'Table'[Year] = MAX('Table'[Year])), SUM('Table'[Count]))

MFelix_0-1714665110183.png

 

MFelix_1-1714665122952.png

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @0Experience ,

 

Add the following measure:

Values Measure = 

IF(ISFILTERED('Table'[Year]), CALCULATE(SUM('Table'[Count]) , 'Table'[Year] = MAX('Table'[Year])), SUM('Table'[Count]))

MFelix_0-1714665110183.png

 

MFelix_1-1714665122952.png

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Thanks @MFelix 

 

Your attached file is woriking expectedly. However, if I write the code on my file and make a new chart, it is not working the expected way. It works like the chart 2.

 

Did you make any other seetings?

 

0Experience_0-1714665896810.png

 

What I understand, you highlighted the filter option from the "interaction" settings from the "Format" option. 

If we do this, then we do not need to write the measure you gave.

 

However, I am accepting your answer as I got the idea from your reply.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors