Forum Discussion
How to count distinct values in a column?
- 8 years ago
Hi patrick-keen,
Select all of the columns and click Unpivot before step 1 above, steps left are same with above.
Regards,
Jimmy Tao
Hi patrick-keen ,
Please refer to steps below:
1.Click Query Editor-> Split Column by Delimiter->Select Comma as a delimiter. Result is like this:
2.Select column1.1 column1.2 column1.3 column1.4 column1.5-> Click Transform-> Unpivot Columns
3.After applied&close, create a measure using DAX like this:
Result = COUNTROWS(Table1)
PBIX file here: https://www.dropbox.com/s/6q124z4g1344796/patrick-keen.pbix?dl=0
Regards,
Jimmy Tao
- patrick-keen8 years agoFrequent Visitor
Hello Jimmy,
this works fine for one column, but I have multiple columns with distinct values and than it doesn't work.
Do you have any solutions for this? Thank you in advanced.
Kind regards,
Patrick Oude Scholten
- v-yuta-msft8 years ago
Community Support
Hi patrick-keen,
Select all of the columns and click Unpivot before step 1 above, steps left are same with above.
Regards,
Jimmy Tao
- patrick-keen8 years agoFrequent Visitor
Hello Jimmy,
I used a part of your solution and added additional querys/tables in Power BI to split them.
Thanks for helping me out.
Kind regards,
Patrick Oude Scholten