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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
PascalvanDongen
New Member

Query for unique values in two columns.

Hello everyone!

 

I am relatively new to Power BI, specifically to using Power Query. I have multiple source files, which all use a certain code to distinguish certain budgets. These codes have a short description, which is always the same for the code. The data looks like the sample below. 

 

In order to define the relationships between my different sources, I'm trying to create a 'master' tab in Power Query, that contains all unique codes and descriptions. How can I do this? I know about List.Distinct, but that doesn't work if I want to do it for two columns. If I try do define relationships now, it doesn't work because the codes are not unique. 

 

The second table shows what I'm trying to achieve.

 

Thanks so much for helping and thinking with me!

 

What I have:

CodeDescriptionAmount
9999X1111Car parts100
8888X2222Truck parts60
9999X1111Car parts-10

 

What I want to create:

CodeDescription
9999X1111Car parts
8888X2222Truck parts
1 ACCEPTED SOLUTION
vanessafvg
Super User
Super User

you mean like this?

 

1. Remove the amount column

2.  highlight both columns and right click remove duplicates.

 

see attached.

vanessafvg_0-1669757543527.png

 

but there are various ways, this is just one way.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
vanessafvg
Super User
Super User

you mean like this?

 

1. Remove the amount column

2.  highlight both columns and right click remove duplicates.

 

see attached.

vanessafvg_0-1669757543527.png

 

but there are various ways, this is just one way.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Thanks so much! I was thinking way to difficult to solve this easy problem.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.