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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
qwertzuiop
Advocate III
Advocate III

Conditional Count

Hello dear Power BI-Community

Following problem to solve:


Let's assume this table
You can imagine this would be a satisfaction survey.

The participant can say "yes" i was happy, "no" i was not happy, or make no statement "not answered"

If not satisfied (Answer = no), the participant gives a reason why.

 

QuestionAnswerReason
AYes-
BNoBecause it was stressful
BNoBecause it was hot 
CNot answered-
DNot answered-

 

The goal is now to calculate the sum of all answered questions

Unfortunately, with this data structure, it is not possible to simply add up the number of "answers" with Yes and No -> Result would be 3, which is wrong

The correct number would be 2 (namely, questions A & B were answered (question B simply justified twice)

 

Any idea how to solve this?

Thank you very much for your contribution.

 

Cheers

qwertzuiop

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@qwertzuiop 

pls try this

Measure = CALCULATE(DISTINCTCOUNT('Table'[Question]),FILTER('Table','Table'[Answer] = "Yes" || 'Table'[Answer]="No"))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ryan_mayu
Super User
Super User

@qwertzuiop 

pls try this

Measure = CALCULATE(DISTINCTCOUNT('Table'[Question]),FILTER('Table','Table'[Answer] = "Yes" || 'Table'[Answer]="No"))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.