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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
yabasha
Frequent Visitor

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
Frequent Visitor

I want to display the result as percentage.

 

Thanx,

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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