Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
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 November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!