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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.