Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
philippa_f
Frequent Visitor

DAX - Need filtered table based on two separate rankings - help!

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:

PRODUCTAMTRANKARANKCCATEGORY 
154640.4266723Cat1 
154641317Cat2 
155030.857Cat1 
15538022Cat1 
155380.222Cat1 
155500.1737Cat2 
155500.4637Cat2 
155500.6637Cat2 

 

Can I do this easily with DAX? Do I use FILTER or CALCULATETABLE? Not sure where to start...

 

Thanks!

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

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:

 

PRODUCTAMTRANK ARANK CCATEGORYERROR?
15464

1

317CAT 1 
155030.857CAT2 
15538    ERROR
155500.1737CAT2 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.