Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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.
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |