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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
VictorV
Helper I
Helper I

Get column matching name base on key

Hi everyone, need help on this one. I use data from table 2, but sometimes the name is not exactly, I want the name it match with the Name form other table that having same code, however sometimes the code in Table 2 is not appear in Table 1, so in that case we will keep the name the same as "Table 2".

 

Please help me!!!!

 

VictorV_0-1712726934170.png

 

1 ACCEPTED SOLUTION
v-heq-msft
Community Support
Community Support

Hi @VictorV ,
Based on the data you provided, I did the following:
Create a column 

Column = 
IF(
    IFERROR(LOOKUPVALUE('Table 1'[Name],'Table 1'[Code],'Table 2'[Code]),'Table 2'[Name]) <> BLANK(),
    IFERROR(LOOKUPVALUE('Table 1'[Name],'Table 1'[Code],'Table 2'[Code]),'Table 2'[Name]),
    'Table 2'[Name]
    )

Final output

vheqmsft_0-1712799726535.png

Best regards,

Albert He

 

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-heq-msft
Community Support
Community Support

Hi @VictorV ,
Based on the data you provided, I did the following:
Create a column 

Column = 
IF(
    IFERROR(LOOKUPVALUE('Table 1'[Name],'Table 1'[Code],'Table 2'[Code]),'Table 2'[Name]) <> BLANK(),
    IFERROR(LOOKUPVALUE('Table 1'[Name],'Table 1'[Code],'Table 2'[Code]),'Table 2'[Name]),
    'Table 2'[Name]
    )

Final output

vheqmsft_0-1712799726535.png

Best regards,

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Thanks a lot!!! it's work perfect

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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