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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors