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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
emily324
Frequent Visitor

Lookup using multiple numbers that are separated by special character

Hi all,

 

Is there a way I can lookup multiple values that are separated by ";" and return the values and have them be separated by ";".

I want to use 'Table 2' to return the values in the 'Names' column using the 'Numbers' column as a key. See the 'desired outcome' table below for what I am looking for. Thank you!!

 

Table 1

Numbers
000; 111; 333

 

Table 2

NumbersNames
000Emily
111Chrissy
222Kathy
333Matt

 

Desired Outcome

NumbersNames
000; 111; 333Emily; Chrissy; Matt

 

Best,

 

Emily

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @emily324,

You can try to use following measure formula to get the correspond name list based on current number string:

formula =
VAR currNumber =
    SELECTEDVALUE ( Table1[Numbers] )
RETURN
    CONCATENATEX (
        CALCULATETABLE (
            VALUES ( Table2[Names] ),
            FILTER (
                ALLSELECTED ( Table2 ),
                SEARCH ( Table2[Numbers], currNumber, 1, -1 ) > 0
            )
        ),
        Table2[Names],
        ","
    )

1.png

Regards,

Xiaoxin Sheng

View solution in original post

5 REPLIES 5
emily324
Frequent Visitor

Any way to remove duplicate names if some of the same names are returned?

Anonymous
Not applicable

Hi @emily324,

You can try to use following measure formula to get the correspond name list based on current number string:

formula =
VAR currNumber =
    SELECTEDVALUE ( Table1[Numbers] )
RETURN
    CONCATENATEX (
        CALCULATETABLE (
            VALUES ( Table2[Names] ),
            FILTER (
                ALLSELECTED ( Table2 ),
                SEARCH ( Table2[Numbers], currNumber, 1, -1 ) > 0
            )
        ),
        Table2[Names],
        ","
    )

1.png

Regards,

Xiaoxin Sheng

Any way to remove duplicate names when the same names are returned?

Wow, works like a charm. Thank you so much!

emily324
Frequent Visitor

The formatting came out weird for the tables... numbers and names are two separate columns. Thanks!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors