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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
jps_HHH
Helper I
Helper I

Connect two different column from two sources

Hi all,

 

I've a powerBI with two sources (or two lists as database). 

I'd like to connect the two lists throught product name and batch number.  

 

List 1

In that list there is a row per each pair "product -> batch number".  But the product can be repeated in several rows (because the batch number change) and the batch number can be repeated because two different product can be the same batch number. 

ProductBatch number

Date 1

Date 2
A10020142015
A101....
B200....
A105.....
C201....
B201....
C202....

 

List 2

In that list is showed the failures detected per pair "product -> Batch".  More than 1 product/batch failure could occur.

 

ProductBatch numberFailure description 
A100bla bla 
A100..bla bla..
B200bla bla..
B200bla bla...
B200bla bla..
C202bla bla..
C202bla bla..
1 ACCEPTED SOLUTION

That's another way to do it but you might run into some problems in the future when you add more tables.  Ideally, what you want to do is to connect a dimension table to a fact table. Sometiems you connect  a fact table to another fact table but that is usually more on the case of, for example, a sales order table to sales order lines/items table.










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

4 REPLIES 4
danextian
Super User
Super User

Hi @jps_HHH 

 

This should be ideally pushed upstream. Add a column in your database called PrductBatch which is the two columns concatenated for both tables/lists.  Create another table/view that unions the ProductBatch columns returning only the distinct values.  Load the two tables with the new column  and the union table. Your model will look like this. Use the column from the bridge table in your viz and the aggregated data from the other two tables.

 

danextian_0-1725361981893.png

I used power query to create the new columns in the sample pbix. There is also one for DAX (least priority).

Notoe: Relationship is one-to-many and single direction.










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Is it not possible to create a new column in each table with "productbatch" (the merger of product name with bathc number) and connect the two tables by "productbatch" ? 

I expected that it would be more simple to solve.  I will try

That's another way to do it but you might run into some problems in the future when you add more tables.  Ideally, what you want to do is to connect a dimension table to a fact table. Sometiems you connect  a fact table to another fact table but that is usually more on the case of, for example, a sales order table to sales order lines/items table.










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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