Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
I have a table where products appear multiple times and I need to create a subset table that just has one record for each product, based on two different scores.
I need the record chosen to be that for the MAX of RankC, but if there are multiple records for the Product with the same value for Rank C, then instead I need whichever record has the MAX of RankA. If there are multiple records with equal value for RankA then I need to show an error. Sample data here:
PRODUCT | AMT | RANKA | RANKC | CATEGORY | |
15464 | 0.42667 | 2 | 3 | Cat1 | |
15464 | 1 | 3 | 17 | Cat2 | |
15503 | 0.8 | 5 | 7 | Cat1 | |
15538 | 0 | 2 | 2 | Cat1 | |
15538 | 0.2 | 2 | 2 | Cat1 | |
15550 | 0.1 | 7 | 37 | Cat2 | |
15550 | 0.4 | 6 | 37 | Cat2 | |
15550 | 0.6 | 6 | 37 | Cat2 |
Can I do this easily with DAX? Do I use FILTER or CALCULATETABLE? Not sure where to start...
Thanks!
Hi, @philippa_f
Are RankA and RankC measures or calculated columns?
How do you want the error message to be displayed? Can you share your desired result in the table?
Best Regards,
Community Support Team _ Eason
Hi Eason
Thanks so much for responding. No, the Rank A and Rank C are not calculations, just variables in the source data.
What I would need to see in the new table would look like this:
PRODUCT | AMT | RANK A | RANK C | CATEGORY | ERROR? |
15464 | 1 | 3 | 17 | CAT 1 | |
15503 | 0.8 | 5 | 7 | CAT2 | |
15538 | ERROR | ||||
15550 | 0.1 | 7 | 37 | CAT2 |
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
110 | |
103 | |
98 | |
90 | |
70 |
User | Count |
---|---|
166 | |
131 | |
129 | |
102 | |
98 |