Forum Discussion

puru85's avatar
puru85
Helper II
1 year ago
Solved

Dynamic URL Filtering for Phone Numbers in Power BI URL

Hi Experts, I have a Customer Dashboard in Power BI that has been published to the Power BI Service. This dashboard includes customer phone numbers and details about their purchases. Context: W...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi puru85 

     

    You can try to create a separate phone table as a slicer, and set a filter in your table visual, associated with the slicer by the “CONTAINSSTRING” DAX function. 

    Here are the detailed steps, hope it can meet your requirement.

    1. Create a separate phone table and then create a slicer with "PhoneNumberFilter" field. ("phone" type:Text)

     

    PhoneFilterTable = SELECTCOLUMNS(
        DISTINCT(Customer_FK[Phone]),
        "PhoneNumberFilter", Customer_FK[Phone]
    )

     

    2. Create a new measure with the following DAX:

     

    FilteredRows = 
    IF(
        CONTAINSSTRING(SELECTEDVALUE(FamilyMembersTable[PhoneNumbers]), SELECTEDVALUE(PhoneFilterTable[PhoneNumberFilter])),
        1, 
        0)

     

    3. Drag "PhoneNumbers" field into the table visual and then drag “FilteredRows” into the Filter panel of the table visual and set the condition to is 1.

    4. Publish to Power BI Service and test.

    example URL: https://app.powerbi.com/groups/{groups_id}/reports/{report_id}?filter=PhoneFilterTable/PhoneNumberFilter eq '4329159883'

     

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