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
adeelnazir786
Helper I
Helper I

Need help in Fuzzy Lookup

Hi Everyone,

Download Source PBIX
I'm new in power BI,
I have 4 tables 1 is actual text/data, 3 are lookup tables (single word, 2 words, 3 words lookup).
I want to filter data table based on lookup table selection as shown in below image. 
Here frequency is dummy, means number of occurance of lookup value in data.

 

Expected Output:

 

image.png

 

 

Thanks & Regards,
Adeel

1 ACCEPTED SOLUTION

Hi @adeelnazir786 ,

 

We can create a measure and use it in visual filter to meet your requirement:

 

VisualControl = 
VAR Title =
    SELECTEDVALUE ( 'data'[title], BLANK () )
RETURN
    IF (
        IF (
            ISFILTERED ( 'Sheet1'[key] ),
            CALCULATE (
                COUNTROWS ( 'Sheet1' ),
                FILTER ( 'Sheet1', CONTAINSSTRING ( Title, [key] ) )
            ) > 0,
            TRUE ()
        )
            && IF (
                ISFILTERED ( 'Sheet2'[key] ),
                CALCULATE (
                    COUNTROWS ( 'Sheet2' ),
                    FILTER ( 'Sheet2', CONTAINSSTRING ( Title, [key] ) )
                ) > 0,
                TRUE ()
            )
            && IF (
                ISFILTERED ( 'Sheet3'[key] ),
                CALCULATE (
                    COUNTROWS ( 'Sheet3' ),
                    FILTER ( 'Sheet3', CONTAINSSTRING ( Title, [key] ) )
                ) > 0,
                TRUE ()
            ),
        1,
        -1
    )

 

7.jpg8.jpg

 


Best regards,

 

Community Support Team _ Dong Li
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

6 REPLIES 6
v-lid-msft
Community Support
Community Support

Hi @adeelnazir786 ,

 

Sorry for that, We cannot understand your data model clearly, Could you please provide a mockup sample  based on fake data or describle the fields of each tables and the relations between tables simply? It will be helpful if you can show us the exact expected result based on the tables. Please upload your files to One Drive and share the link here.
 
Please don't contain any Confidential Information or Real data in your reply.
 
Best regards,

 

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

@v-lid-msft , I dont know what was happened,

Actually post was editted by mobile, after that image and source file becomes raw text 🙂

Can you please lookinto my problem, thanks in advance.

Hi @adeelnazir786 ,

 

We can create a measure and use it in visual filter to meet your requirement:

 

VisualControl = 
VAR Title =
    SELECTEDVALUE ( 'data'[title], BLANK () )
RETURN
    IF (
        IF (
            ISFILTERED ( 'Sheet1'[key] ),
            CALCULATE (
                COUNTROWS ( 'Sheet1' ),
                FILTER ( 'Sheet1', CONTAINSSTRING ( Title, [key] ) )
            ) > 0,
            TRUE ()
        )
            && IF (
                ISFILTERED ( 'Sheet2'[key] ),
                CALCULATE (
                    COUNTROWS ( 'Sheet2' ),
                    FILTER ( 'Sheet2', CONTAINSSTRING ( Title, [key] ) )
                ) > 0,
                TRUE ()
            )
            && IF (
                ISFILTERED ( 'Sheet3'[key] ),
                CALCULATE (
                    COUNTROWS ( 'Sheet3' ),
                    FILTER ( 'Sheet3', CONTAINSSTRING ( Title, [key] ) )
                ) > 0,
                TRUE ()
            ),
        1,
        -1
    )

 

7.jpg8.jpg

 


Best regards,

 

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

@v-lid-msft 

Great work! Please share dax to calculate the frequency (Existance count) of selected text (lookup text).

@v-lid-msft ,

 

I've been use part of your formula which returns the number of findings, that really working 😛 

CALCULATE (
                COUNTROWS ( Sheet1 ),
                FILTER ( Sheet1, CONTAINSSTRING ( Title, [key] ) )
            )

 Thanks & Regards,

Adeel

 

Hi @adeelnazir786 ,

 

Glad to hear that you have resolved your problem. Thank you for sharing this wonderful solution, we believe it can benefit more users. If you have any other questions about this scenario, please kindly ask here and we will try to resolve it.


Best regards,

 

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

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.