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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
qwertzuiop
Advocate III
Advocate III

Conditional count

Hello dear Power-BI-Community

 

Following problem to solve:

Let's assuem this table:

 

PersonCheck
A1
A0
A0
B0
B0
C1
C1
D0
D0
D0

 

People must carry out checks.
Person A, for example, has to carry out the check 3x (1x done so far).
Person B has to carry out the check 2x (0x done so far)

And so on...

 

The aim is to use a measure to calculate how many people have not yet carried out a check.

Solution to this would be 2 (Person B & D)

 

Thank you very much for your contribution.

 

Cheers

qwertzuiop

 

1 ACCEPTED SOLUTION
rsbin
Community Champion
Community Champion

@qwertzuiop ,

As @Syk , suggested, this is easiest done in two steps.  I would do it this way.

Create a new Calculated Column:

TotalChecks = CALCULATE( SUM(Checks[Check] ),
                     ALLEXCEPT( Checks, Checks[Person] ))

PersonCheckTotalChecks

A 1 1
A 0 1
A 0 1
B 0 0
B 0 0
C 1 2
C 1 2
D 0 0
D 0 0
D 0 0

Then create a new Measure:

0_Checks = CALCULATE( DISTINCTCOUNT( Checks[Person] ),
                     FILTER( Checks, Checks[TotalChecks] = 0 ))

Trust this works for you.

Regards,

View solution in original post

3 REPLIES 3
rsbin
Community Champion
Community Champion

@qwertzuiop ,

As @Syk , suggested, this is easiest done in two steps.  I would do it this way.

Create a new Calculated Column:

TotalChecks = CALCULATE( SUM(Checks[Check] ),
                     ALLEXCEPT( Checks, Checks[Person] ))

PersonCheckTotalChecks

A 1 1
A 0 1
A 0 1
B 0 0
B 0 0
C 1 2
C 1 2
D 0 0
D 0 0
D 0 0

Then create a new Measure:

0_Checks = CALCULATE( DISTINCTCOUNT( Checks[Person] ),
                     FILTER( Checks, Checks[TotalChecks] = 0 ))

Trust this works for you.

Regards,

qwertzuiop
Advocate III
Advocate III

Hello @Syk 

First of all - thank you very much for your support.
Unfortunately it is not yet solved.

 

With your measure, I count the distinct sum of people who have at least 1x 0.

In the table above it would be the person A,B,D based on your measure.
Person A should not to be counted because it has already carried out a control.

 

Goal is: Count the number of people who have not yet carried out any check.

 

Any ideas?

Syk
Resident Rockstar
Resident Rockstar

You can create a measure to sum your checks and then another to check for sum < 1. (You could also skip the first measure if your column is already summed)

It would be something like...

people_not_checked = CALCULATE(DISTINCTCOUNT('Table'[Person]),'Table'[Check]<1)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.