Say I have this data structure
Order Number | Product Type |
---|---|
123 | A |
123 | B |
123 | C |
123 | C |
234 | A |
557 | B |
557 | C |
I would like to group by distinct values of product type per key so I get the following
Order Number | Product Type Distinct Count |
---|---|
123 | 3 |
234 | 1 |
557 | 2 |
How do I do it in DAX? I currently have something like the below but it gives me 3 for each row since it doesn't count per Order Number
EVALUATE(
SUMMARIZECOLUMNS(
[Order Number],
"Product Type Distinct Count", DISCTINCTCOUNT([Product Type])
)
)
Thank you!!!!