Forum Discussion

olab's avatar
olab
New Member
7 years ago
Solved

Lookup based on text starting with....

Hello,

For some time I have been working on a relation/lookup in PowerBI but have not been able to solve it. Now I'm askin the community for help.

 

I have two tables:

Team - Containing all maintenance teams and their responsible scope

 

Equipment - Containing all equipment.

 

In the equipment table I need to do a lookup to find the correct team based on the starting text of Team (Something like the LIKE function in SQL)

Can someone give me an idea on how to do this?

 

Ol

  • olab

     

    This calculated column works with your sample data

     

    column =
    CALCULATE (
        MAX ( Team[TeamID] ),
        FILTER ( Team, SEARCH ( [Key], [EquipmentID], 1, 0 ) > 0 )
    )
    

1 Reply

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Icon for Community Champion rankCommunity Champion

    olab

     

    This calculated column works with your sample data

     

    column =
    CALCULATE (
        MAX ( Team[TeamID] ),
        FILTER ( Team, SEARCH ( [Key], [EquipmentID], 1, 0 ) > 0 )
    )