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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
jonoren
Frequent Visitor

Remove rows based on an arbitrary rule

Hi! so I have a table of currencies and their corresponding countries, and some countries have more than one currency (so they have more than one row in this table). Moreover, I need to merge this table with a "Countries" table such that every country has a single selected currency.

jonoren_0-1659915666347.png

For example for Bhutan I want to choose BTN and not INR.

I can't perform this merger because in the Countries table the country is a primary key, and this merger creates multiple rows of the same country. In addition, I can't simply remove the INR rows because then I'd lose India. This seems very simple, but I can't seem to understand how to delete these specific rows.

 

Thank you!

1 ACCEPTED SOLUTION
jonoren
Frequent Visitor

Because the rule is completely arbitrary, and I know for a fact that the order of the rows, as well as the number of them, won't ever change, I solved this by simply creating an index column and filtering by it, manually removing the indexes I'm not interested in. In the end it was a very easy solution.. Thanks anyway guys! 

View solution in original post

3 REPLIES 3
jonoren
Frequent Visitor

Because the rule is completely arbitrary, and I know for a fact that the order of the rows, as well as the number of them, won't ever change, I solved this by simply creating an index column and filtering by it, manually removing the indexes I'm not interested in. In the end it was a very easy solution.. Thanks anyway guys! 

jbwtp
Memorable Member
Memorable Member

Hi @jonoren,

 

What is your selection logic to choose BTN vs INR? Can this be formalised to be programmed? If this is based on some "knowledge" you will need a translation table in the fashion that @MarCat mentioned.

 

Otherwise the method quite simple. Instead of choosing Expand when expending column choose Aggergate:

jbwtp_0-1659929542030.png

and then select anything (Count would do). Once the step is created change List.Count  in the formula to List.Last or some other computation that would produce a single result from a list of options.

 

If you need more help on this one, share your computation logic over selecting a paarticular currency from multiple options.

 

Thnaks,

John 

MarCat
Regular Visitor

You could add a column to the curreny table that acts as a flag for which currency to keep, filter on this flag and then merge.  Well, I think that would work.  Also if it doesn't matter which one the system keeps (could hardly imagine this though) then of course you could simply remove the duplicates based on the country field.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.