Forum Discussion
JoseAriel
8 years agoFrequent Visitor
Count unique values
Hello, I have a table which I hope to display along with a visualization Card indicating the total count of PastDue values in the therapy column which in this case would be 1. Any thoughts on wha...
- 8 years ago
Hey,
I'm wondering why it's 1, I would count it 2, because there are two unique id_no with the value "PastDue" ,but nevertheless.
This measure should return 1
CALCULATE( DISTINCTCOUNT('yourtable'[therapy]) ,'yourtable'[therapy] = "PastDue" )Hopefully this is what you are looking for
Regards
Tom
TomMartens
8 years agoSuper User
Hey,
I'm wondering why it's 1, I would count it 2, because there are two unique id_no with the value "PastDue" ,but nevertheless.
This measure should return 1
CALCULATE(
DISTINCTCOUNT('yourtable'[therapy])
,'yourtable'[therapy] = "PastDue"
)Hopefully this is what you are looking for
Regards
Tom
JoseAriel
8 years agoFrequent Visitor
Awesome!! You're right. Should have been 2. I used Count instead of distinct count. Seems to work. Thanks again. I am new to this. Deffinately enjoying the ride. Thanks again.
| id_no | therapy | next_therapy |
| A | Ok | 2/28/2018 |
| B | Ok | 12/6/2017 |
| C | PastDue | |
| D | DueSoon | 10/11/2017 |
| E | PastDue | 5/17/2017 |
| F | Ok | 1/5/2018 |