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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
u4us1923
Frequent Visitor

Get value from another table with multiple conditions.

Hello. I have two tables as below. I want to create a custom column (Total Calls) in table2 and if the city and location values are equal, I want to add the count data in table1 to the Total Calls column in table2. How can I do this in powerquery?

 

u4us1923_1-1727352012162.png

 

 

2 ACCEPTED SOLUTIONS
mussaenda
Super User
Super User

Hi @u4us1923 ,

 

We can do this with simple merge and select 2 columns for each table.

View solution in original post

mermanahan
Frequent Visitor

When you are merging the 2 tables in power query, you need to select both "city" and "location" by holding the CTRL key in order to select both. Do the same for table 2. You need to join on these two columns.

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @u4us1923 ,

 

Here is the procedure. Please refer to mermanahan's response to holding CTRL key while selecting multiple columns.
2024-09-27_14-04-00.gif

The pbix file is attached for reference.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum 

Omid_Motamedise
Super User
Super User

Use merging the tables

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h
mermanahan
Frequent Visitor

When you are merging the 2 tables in power query, you need to select both "city" and "location" by holding the CTRL key in order to select both. Do the same for table 2. You need to join on these two columns.

 

mussaenda
Super User
Super User

Hi @u4us1923 ,

 

We can do this with simple merge and select 2 columns for each table.

I have shown it as simple. normally there are too many columns in Table1... the columns of both tables are not the same unfortunately

Hi @u4us1923 ,

 

it is not limited only for 2 columns, you can select as many columns as you want to merge them

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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