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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Divous
Helper III
Helper III

Display the selected value relative to the whole in a graph

Hey community,

 

can I ask for your help?

I have a (simplified) table of students and their completed exams:

student_id exam
1 A
1 B
2 B
3 A
3 B
3 C
4 A
4 B
5 C

 

I would need a pie chart where after selecting e.g. exam "A" from slicer, I can see the number of students who have passed the exam and how many have not. So in this example I will see in the pie chart 3 yes, 2 no.

Thank you in advance

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi, @Divous 

According to your description, you want to “I would need a pie chart where after selecting e.g. exam "A" from slicer, I can see the number of students who have passed the exam and how many have not. So in this example I will see in the pie chart 3 yes, 2 no.

Here are the steps you can refer to :
(1)My test data is the same as yours.

(2)We can create two measures:

Passed Measure = COUNTROWS( VALUES('Table'[student_id]))
Not Paswsed Measure = COUNTROWS(ALL('Table'[student_id])) -COUNTROWS( VALUES('Table'[student_id]))

(3)Then we can put the measures on the visual and we can meet your need:

vyueyunzhmsft_0-1675734278403.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors