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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Kudoed Authors