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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
litifeta
Frequent Visitor

Count number of people who have met a specific condition

In Power BI data, I have one column with (text) names, and in another column a number to indicate a condition is met. For example

 

Name               Condition

John                        1

Andrew                   0

Kay                         0

John                        1

John                        1

Andrew                   1

 

In the example I would want to count the names that have the condition 1 without duplicates. For instance the correct response would be 2, as John has met the condition on more than one occassion, and Andrew has met the condition once. (i.e.) count the number of people who have met the condition 1.

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

@litifeta Try this...

 

Measure =
CALCULATE (
    DISTINCTCOUNT ( TableName[NameColumn] ),
    FILTER ( TableName, TableName[ConditionColumn] = 1 )
)

View solution in original post

4 REPLIES 4
Baskar
Resident Rockstar
Resident Rockstar

Do the following steps

1. Choose distcount from your measure

 

1. 111.PNG

 

2. Set the visual level filter is equal = 1, thats all very simple

 

112.PNG

 

let me know if its not working

thanks you folks are awesome

If u okay with the solution , pls close the ticket, cool buddy

Sean
Community Champion
Community Champion

@litifeta Try this...

 

Measure =
CALCULATE (
    DISTINCTCOUNT ( TableName[NameColumn] ),
    FILTER ( TableName, TableName[ConditionColumn] = 1 )
)

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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