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
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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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
Top Kudoed Authors