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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vijenkin
Employee
Employee

Take data from column in one table and combine it with column in another table

Hello, I've been trying to wrap my head around a problem I have been having for the past few hours. Right now I have two tables. Both tables have an ID Number and an associated name. However, Table1, which is being pulled from a database, has a number of rows in which there is an ID Number but no associated Name. As Table1 is being pulled from a database it has multiple instances of the IDNumber and Name happening as it is keeping track of the instances hapening on the system.

 

Table2, being pulled from an excel sheet, has distinct rows in which the blank Names from Table1 do have their corresponding IDNumbers. 

 

I am trying to figure out if there is a way to "insert" the Names from Table2 into the Name column on Table1 if the IDNumber in both tables are a match. 

 

Thinking about it from a PseduoCode pespective this is what my thought process is. I did try to get this to work in DAX but couldn;t figure that out properly. 

IF (Table1[IDNumber] == Table2[IDNumber] && Table[Name] ISBlank)
{
Table2[Name] = Table1[Name]
}

 

Any help or direction would be greatly appreciated. Thanks.

 

I will not be able to share the PBIX file or provide screenshots of the actual data for privacy reasons

Table1

Column1

Column2

IDNumber

Name

Column3

 

 

12345

Name1

 

 

 

12345

Name1

 

 

 

67890

Name2

 

 

 

24680

Name3

 

 

 

13579

Name4

 

 

 

90987

 

 

 

 

29475

 

 

 

 

09876

 

 

 

Table2

Column1

Column2

IDNumber

Name

 

 

90987

Name5

 

 

29475

Name6

 

 

09876

Name7

 

 

1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @vijenkin 

You may create a column with below formula:

Column =
IF (
    Table1[Name] = BLANK (),
    CALCULATE (
        MAX ( Table2[Name] ),
        FILTER ( Table2, Table2[IDNumber] = Table1[IDNumber] )
    ),
    Table1[Name]
)

a1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-cherch-msft
Employee
Employee

Hi @vijenkin 

You may create a column with below formula:

Column =
IF (
    Table1[Name] = BLANK (),
    CALCULATE (
        MAX ( Table2[Name] ),
        FILTER ( Table2, Table2[IDNumber] = Table1[IDNumber] )
    ),
    Table1[Name]
)

a1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-cherch-msft This helped quite a bit however, the results were not quite as clean as I hoped but that is due to a few other caveats with my data. That being said I have made other adjustments to accomondate that. Thank you very much. Marked as solution

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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