Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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.