cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gauteweb
Advocate II
Advocate II

DISTINCTCOUNT with an IF, possible?

Hi. I've worked with Power BI for about 6 months, but not fiddled to much with DAX. Now I'm faced with an issue.

 

I have a table with two fields, Name and Value. I want to do a DISTINCTCOUNT of names, but only those where they have a value >0.

 

Any tips?

1 ACCEPTED SOLUTION
Gauteweb
Advocate II
Advocate II

OK, so I think I figured it out:

DistinctNames =
CALCULATE(
DISTINCTCOUNT(CosmosDB[Name]); CosmosDB[Value]>0)

View solution in original post

1 REPLY 1
Gauteweb
Advocate II
Advocate II

OK, so I think I figured it out:

DistinctNames =
CALCULATE(
DISTINCTCOUNT(CosmosDB[Name]); CosmosDB[Value]>0)

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Top Solution Authors
Top Kudoed Authors