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.
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 |
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 |
---|---|
110 | |
97 | |
78 | |
64 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |