Forum Discussion
JCuoco
4 years agoRegular Visitor
Distinct Count one column with Contained Strings from another
Team, I would like to do a distinct count on a column (Total Encounters) but only count the encounters that also have the value of "No Show" in a separate column Thanks, James
- 4 years ago
Hi JCuoco
You need to use Calculation with filter:
If you want to filter the table to show the rows which have "No Show" in a seperate column:
Measure =
Calculate(DISTINCTCOUNT(table[Total Encounters]),Filter(table,table[separate column]="No Show"))
If "No Show" is part of the values of data in seperate column, use ValtteriN solution.If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
ValtteriN
Community Champion
4 years agoHi,
Here is one way to do this:
Dax:
Apples =
calculate(COUNT(Applecount[AppleCount]),ALL(Applecount)) //Calculate all fruits
-
CALCULATE(DISTINCTCOUNT(Applecount[AppleCount]),
iserror(SEARCH("Apple",Applecount[AppleCount])),ALL(Applecount[AppleCount])) //calculate NOT apples
End result:
End result:
I hope this helps and if it does consider accepting this as a solution and giving the post a thumbs up!