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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NVieira
Regular Visitor

Count on distinct cell

Hi,

I'm working with a dataset like the one below.
I would like to count the number of "found"/"not found" for distinct IDs and with Status Closed

So, for the example below the expected result would be found =2 and not found =1

 

How can i manage this in PowerBI desktop?

 

 

 

IDStatusReason
21300CLOSED found
21300CLOSED found
21300CLOSED found
21300CLOSED found
21301CLOSED found
21302IN_PROGRESS 
21303CLOSED not found
21304IN_PROGRESS 
21305IN_PROGRESS 
1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

@NVieira

How about these 2 Measures... Smiley Happy

 

Found Measure =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[ID] ),
    FILTER ( 'Table', 'Table'[Reason] = "Found" && 'Table'[Status] = "Closed" )
)

Not Found Measure =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[ID] ),
    FILTER ( 'Table', 'Table'[Reason] = "Not Found" && 'Table'[Status] = "Closed" )
) 

 

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @NVieira,

 

You could have a try with the formula below.

 

Measure =
CALCULATE (
    DISTINCTCOUNT ( 'Table1'[ID] ),
    FILTER ( ALLEXCEPT ( Table1, Table1[Reason] ), 'Table1'[Status] = "CLOSED" )
)

Here is the result output.

 

measure result.PNG

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Sean
Community Champion
Community Champion

@NVieira

How about these 2 Measures... Smiley Happy

 

Found Measure =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[ID] ),
    FILTER ( 'Table', 'Table'[Reason] = "Found" && 'Table'[Status] = "Closed" )
)

Not Found Measure =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[ID] ),
    FILTER ( 'Table', 'Table'[Reason] = "Not Found" && 'Table'[Status] = "Closed" )
) 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.