cancel
Showing results for 
Search instead for 
Did you mean: 
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.

View solution in original post

yabasha
Frequent Visitor

I want to display the result as percentage.

 

Thanx,

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors