Forum Discussion
Count or distinct count
Hi Community,
I have a column in my data that has a type of "text" but when I try to do a count or distinct count of the data, it just doesnt work. Can anyone help?
The example is as follows:
| Code |
| 4110 - Uni |
| 4112 - Coll |
| 4131 - Store |
| 4121 - STA |
| 4110 - Uni |
| 4110 - Uni |
| 4110 - Uni |
| 4121 - STA |
| 4131 - Store |
| 4131 - Store |
| 4121 - STA |
| 4131 - Store |
| 4131 - Store |
| 4121 - STA |
The output should be:
| Code | Count |
| 4110 - Uni | 4 |
| 4112 - Coll | 1 |
| 4131 - Store | 5 |
| 4121 - STA | 4 |
Any help would be greatly appreciated.
TIA
8 Replies
- richbenmintzResident Rockstar
The following measures should give you the counts you are looking for
Count = CountRows('table')Distinct Count = DISTINCTCOUNT('table'[column])I hope this helps,
Richard
- AnonymousNot applicable
Hi UK_User123456 ,
Don't know what steps you are following .However when I tried with your example in a table Visual, I get the output as expected:
see screnshot below:
Thanks,
Tejaswi
- UK_User123456Resolver I
But would this work if it was referenceing a measure that was calculated?
- UK_User123456Resolver I
I have a calculated measure that is based upon a ranking column in my base data, I then wanted to count the number of times those codes appear.