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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Multiple IF conditions different tables

Hi,

 

I have problem with DAX. I need to combine data between two tables if some criteria is met.

 

Tables;
PriceTable, Contains prices, customer IDs, product IDs and dates

Receided goods table, Contains data about received goods, quantity, customer ID, productID and dates

 

So I have to get both received goods and the price to the same table when

Price table customer ID = Received goods table Customer ID

Price table product ID = Received goods table Product ID

Price table Date = Received goods table Date

 

Is there anyone who might have idea how to combine those data?

1 ACCEPTED SOLUTION
SamInogic
Super User
Super User

Power BI provides a feature of combining the data from two tables based on columns with the same values.

In your requirement, it seems that you have two tables “Price Table”, and “Received Goods” and want to combine these tables using CustomerID, ProductID, and Date columns from both tables.

So in order to combine both tables using these 3 column values, you can follow the below steps and combine the tables to create a new table with common values.

1. Navigate to Power Query Editor and click on the Transform tab which has the option for Combine>> Merge Queries>> Merge Queries as New.

SamInogic_0-1670904566702.jpeg2. This will open the Merge dialog and select the columns required to have same values i.e. in these case select Customer ID, Product ID and Date (PriceTable)/ Received goods Date (Received goods) table. Select the Join Kind as Inner join as we want only matching rows to be filtered out in new table.

SamInogic_1-1670904566714.jpeg3. This will create a new table with rows matching for both table based on selected columns.

Please refer to the below screenshot for the same.

 

SamInogic_2-1670904566717.jpeg

Output for the merging tables will be as follows:

SamInogic_3-1670904566721.jpeg

If this answer helps, please mark it as Accepted Solution so it would help others to find the solution.

 

Thanks!

Inogic Professional Services
An expert technical extension for your techno-functional business needs
Power Platform/Dynamics 365 CRM
Drop an email: crm@inogic.com
Service: http://www.inogic.com/services/
Power Platform/Dynamics 365 CRM Tips and Tricks: http://www.inogic.com/blog/

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/

View solution in original post

4 REPLIES 4
SamInogic
Super User
Super User

Power BI provides a feature of combining the data from two tables based on columns with the same values.

In your requirement, it seems that you have two tables “Price Table”, and “Received Goods” and want to combine these tables using CustomerID, ProductID, and Date columns from both tables.

So in order to combine both tables using these 3 column values, you can follow the below steps and combine the tables to create a new table with common values.

1. Navigate to Power Query Editor and click on the Transform tab which has the option for Combine>> Merge Queries>> Merge Queries as New.

SamInogic_0-1670904566702.jpeg2. This will open the Merge dialog and select the columns required to have same values i.e. in these case select Customer ID, Product ID and Date (PriceTable)/ Received goods Date (Received goods) table. Select the Join Kind as Inner join as we want only matching rows to be filtered out in new table.

SamInogic_1-1670904566714.jpeg3. This will create a new table with rows matching for both table based on selected columns.

Please refer to the below screenshot for the same.

 

SamInogic_2-1670904566717.jpeg

Output for the merging tables will be as follows:

SamInogic_3-1670904566721.jpeg

If this answer helps, please mark it as Accepted Solution so it would help others to find the solution.

 

Thanks!

Inogic Professional Services
An expert technical extension for your techno-functional business needs
Power Platform/Dynamics 365 CRM
Drop an email: crm@inogic.com
Service: http://www.inogic.com/services/
Power Platform/Dynamics 365 CRM Tips and Tricks: http://www.inogic.com/blog/

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/
Anonymous
Not applicable

Hi and first of all thanks for answering. 

 

I actually managed to come out with the identical solution and I can say that it works well. 

tamerj1
Super User
Super User

Hi @Anonymous 
Any relationship between the two table?

Anonymous
Not applicable

Hi,

Not at the moment, as I have tried to figure out the best way to merge those queries.

 

I have tried to do a new key between the tables by using CustomerID+ProductID+FirstDayOfTheMonth. Doing it to both queries and merge queries by those keys.

 

I also found a slight problem with our data so I will update here if my solution will work after I have fixed the data. 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.