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! Request now

Reply
yabasha
Advocate II
Advocate II

Count occurrences of Yes values

Hi,

 

I have excel data imported into power bi and one of the columns is yes_no column which lists people who said yes and who said no and I want to count the numbe of Yes and the number of No and display the result in pie chart, I tried many solutions for my issue but nothing worked, I could do that in excel with countif() but not in power bi.

col.png

 

 

 

 

Please Advice,

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @yabasha,

 

You can create a measure below: 

Percentage = DIVIDE(COUNT(Table1[yes_no]),CALCULATE(COUNT(Table1[yes_no]),ALL(Table1))) 

 

e4.PNG

 

Or you can drag the yes_no column to pie chart Values section and set the "Percent of grand total". 

 

e5.PNG

 

For details, you can download attached pbix file. 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-qiuyu-msft
Community Support
Community Support

Hi @yabasha,

 

You can create a measure below: 

Percentage = DIVIDE(COUNT(Table1[yes_no]),CALCULATE(COUNT(Table1[yes_no]),ALL(Table1))) 

 

e4.PNG

 

Or you can drag the yes_no column to pie chart Values section and set the "Percent of grand total". 

 

e5.PNG

 

For details, you can download attached pbix file. 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
yabasha
Advocate II
Advocate II

I want to display the result as percentage.

 

Thanx,

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