Forum Discussion
Countrows if ID is unique
- 2 years ago
Hello Peter_K
please check if this accomodate your need.
I made a random data based on your problem.
Create a measure with following DAX:
Count =var _Message = SELECTEDVALUE('Table'[Message])ReturnCALCULATE(DISTINCTCOUNT('Table'[ChatID]),FILTER('Table','Table'[Message]=_Message))If this result doesnt match to your problem, please give a set of dummy data that can represent your whole data.Hope this will help you.Thank you. - 2 years ago
Hello Peter_K ,
that happens because of the filter in calculate DAX. The total seems not be able to be calculated properly.
In my sample data, the total didnt even show up.
To solve this, simply just remove the filter and use DISTINCTCOUNT directly
In fact, if your data has uniqueID for every message, I think direct distinctcount should do the job (no need put any filter by calculate DAX).
But please give it a try first and let see if you get the correct value or not by using direct distinctcount.
Hope this will help you.
Thank you.
Hello Peter_K
please check if this accomodate your need.
I made a random data based on your problem.
Create a measure with following DAX:
Thank you so much Irwan That totally solved my problem.
I am so happy now, i really tried so many things, nothing worked the way i wanted.
You solved it, thank you. Never thought it was under measure.
You know why it show 14 as total?
- Irwan2 years agoSuper User
Hello Peter_K ,
that happens because of the filter in calculate DAX. The total seems not be able to be calculated properly.
In my sample data, the total didnt even show up.
To solve this, simply just remove the filter and use DISTINCTCOUNT directly
In fact, if your data has uniqueID for every message, I think direct distinctcount should do the job (no need put any filter by calculate DAX).
But please give it a try first and let see if you get the correct value or not by using direct distinctcount.
Hope this will help you.
Thank you.