Forum Discussion
karkar
Helper III
9 years agoDISTINCT VALUE
Hello, How can I get unique value per ID from the below example? Currently it is giving the count of meas_value. i tried to change it to Calculate(DISTINCTcount(Query1[value]), in the below form...
- Anonymous9 years ago
Please check if the following DAX returns your expected result.
Total Count = Calculate(max(Query1[value]),Filter(ALL(Query1[Admission_Hours]),Query1[Admission_Hours] >72))
Regards,
MFelix
Super User
9 years agoHi karkar,
You should do the distinct count on the ID column not on the value because it's what you want to count not the value column.
Regards,
MFelix
You should do the distinct count on the ID column not on the value because it's what you want to count not the value column.
Regards,
MFelix
karkar
Helper III
9 years agoLike THIS?
Total Count = Calculate(DISTINCTcount(Query1[ID]),
Filter(ALL(Query1[Admission_Hours]),Query1[Admission_Hours] >72))
But I ALSO WANT TO SHOW THE UNIQUE "VALUES" AN id CONTAINS
- karkar9 years ago
Helper III
Currently the output is (since its counting 7 times)
ID totalcount
101 7
WANT:
ID totalcount
101 0 (DISTINCT VALUE FOR EACH 'ID')
- Anonymous9 years agoNot applicable
Please check if the following DAX returns your expected result.
Total Count = Calculate(max(Query1[value]),Filter(ALL(Query1[Admission_Hours]),Query1[Admission_Hours] >72))
Regards,