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, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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