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.
Dear colleagues,
Could you please advise how to create a column with distinct count on a category level.
The data is quite simple.
product id | part |
1 | red |
2 | green |
2 | green |
3 | blue |
3 | black |
The result should be
product id | part | distinct count of parts on a product level |
1 | red | 1 |
2 | green | 1 |
2 | green | 1 |
3 | blue | 2 |
3 | black | 2 |
I tried to play with
Solved! Go to Solution.
Hi @vyacheslavg
Try this for your new calculated column (close to what you already had):
NewColumn= CALCULATE ( DISTINCTCOUNT ( 'Table1'[version] ), ALLEXCEPT ( 'Table1', 'Table1'[product id] ) )
Hi,
This calculated column formula works as well
=CALCULATE(DISTINCTCOUNT(Table1[part]),FILTER(Table1,Table1[product id]=EARLIER(Table1[product id])))
Hope this helps.
Hi @vyacheslavg
Try this for your new calculated column (close to what you already had):
NewColumn= CALCULATE ( DISTINCTCOUNT ( 'Table1'[version] ), ALLEXCEPT ( 'Table1', 'Table1'[product id] ) )
Thanks for the solution, and even I was "close", yay.
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 | |
100 | |
77 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |