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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
Super User
Super User

@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
Super User
Super User

@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
Super User
Super User

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

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors