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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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