Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
How can I count distinct values in one column? For example this column has max. 5 options.
Customer demand,Monthly recurrent revenue,Innovation,Scalability & Flexibility,Efficiency separated by ( , )
Customer demand,Monthly recurrent revenue,Innovation,Scalability & Flexibility,Efficiency
Customer demand,Monthly recurrent revenue,Innovation,Scalability & Flexibility,Efficiency
Customer demand,Innovation,Efficiency
Innovation,Scalability & Flexibility,Efficiency
Monthly recurrent revenue,Innovation
Monthly recurrent revenue,Innovation
Monthly recurrent revenue,Innovation,Scalability & Flexibility
The sum should be:
Customer demand = 3
Monthly recurrent revenue = 5
Innovation = 7
Scalability & Flexibility = 4
Efficiency = 4
Kind regards, Patrick
Solved! Go to Solution.
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
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
Hi patrick-keen,
Select all of the columns and click Unpivot before step 1 above, steps left are same with above.
Regards,
Jimmy Tao
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
@patrick-keen wrote:Hello,
How can I count distinct values in one column?
Does DISTINCTCOUNT not give you what you want?
Can you give an example?
Table values:
Customer demand,Monthly recurrent revenue,Innovation,Scalability & Flexibility,Efficiency
Customer demand,Monthly recurrent revenue,Innovation,Scalability & Flexibility,Efficiency
Customer demand,Innovation,Efficiency
Innovation,Scalability & Flexibility,Efficiency
Monthly recurrent revenue,Innovation
Monthly recurrent revenue,Innovation
Monthly recurrent revenue,Innovation,Scalability & Flexibility
for example:
Customer demand the sum should be 3
Monthly recurrent revenue the sum should be 5
Innovation the sum should be 7
Scalability & Flexibility the sum should be 4
Efficiency the sum should be 4
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |