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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
patri0t82
Post Patron
Post Patron

Creating Column Chart, Counting If Yes,

Hi, I'm very new to Power BI. I've tried searching for this answer, but am only seeing similar questions, but not quite exact.

 

I would like to create a bar/column chart. The Horizontal Axis contains Shifts (A, B, C, D, Days, Other Shift). There are four columns for which the values are counted from. (Behavioural, Hazard, Risk, Near Miss). I need the chart to show me a count of the word "Yes" from each of the four columns, however, I can only seem to apply "Yes" to one at a time. In the example below, it's only showing the total combined "Yes", "No" and blanks.

 

Chart.PNG

1 ACCEPTED SOLUTION

Yeah, I guess that the default action of Power BI would just be to count all. If you make a measure similar to what I wrote in my previous post for each of your four columns, it should work as they'll only consider rows where the relevant column contains yes.

View solution in original post

5 REPLIES 5
jthomson
Solution Sage
Solution Sage

What exactly are you feeding into the visual? Are you putting in a measure that has something like BehaviouralCount = calculate(countrows[yourtable],Behavioural="Yes"), or something else?

I think that's just it, I don't know what I'm doing 😞 I've just created the chart and dragged my columns into it. I'm trying to adjust the filters, but I'm thinking I need to use measures?

Yeah, I guess that the default action of Power BI would just be to count all. If you make a measure similar to what I wrote in my previous post for each of your four columns, it should work as they'll only consider rows where the relevant column contains yes.

Ahh, I tried this and it seems to be working

 

HazardCount = calculate(countrows(SafetyLink),SafetyLink[Did you complete a Hazard Elimination]="Yes")

 

Thanks so much!

I really appreciate your help - would you be able to explain the syntax of your formula a bit? Which part is the Exact column header, etc.?

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.