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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

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
Community Champion
Community Champion

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.
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
Community Champion
Community Champion

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.