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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.