Forum Discussion
Help on DAX-DISTINCTOUNT
- 6 years ago
hi, Alvarom1
You could try this way as below to get it:
Step1:
Create a measure that DISTINCTCOUNT different colors of each letter.
different colors each Letter = CALCULATE(DISTINCTCOUNT('Table'[Color]))Step2:
Create a measure that DISTINCTCOUNT while colors of each letter.
Only white each letter = CALCULATE(DISTINCTCOUNT('Table'[Letter]),FILTER('Table','Table'[Color]="White"))Step3:
Then use this measure to get your requirement:
Result = CALCULATE(DISTINCTCOUNT('Table'[Letter]),FILTER(VALUES('Table'[Letter]),[different colors each Letter]=[Only white each letter]))Result:
and here is sample pbix file, please try it.
Regards,
Lin
hi, Alvarom1
You could try this way as below to get it:
Step1:
Create a measure that DISTINCTCOUNT different colors of each letter.
different colors each Letter = CALCULATE(DISTINCTCOUNT('Table'[Color]))
Step2:
Create a measure that DISTINCTCOUNT while colors of each letter.
Only white each letter = CALCULATE(DISTINCTCOUNT('Table'[Letter]),FILTER('Table','Table'[Color]="White"))
Step3:
Then use this measure to get your requirement:
Result = CALCULATE(DISTINCTCOUNT('Table'[Letter]),FILTER(VALUES('Table'[Letter]),[different colors each Letter]=[Only white each letter]))
Result:
and here is sample pbix file, please try it.
Regards,
Lin
HI Again,
as I confirmed, it works.
The issue that I have now is that the database is big and when it comes to calculate the last measure it takes a long time (several minutes) until the result appears.
Any idea to make it faster?
Thanks
Alvaro