Forum Discussion

Bryan1908's avatar
Bryan1908
New Member
3 years ago
Solved

Filtering table visual based on selected value of a slicer from another table

I have 2 tables: Ingredients List and Distinct Ingredients. 

 

Distinct Ingredients table:

 

Ingredients List table:

 

I've been trying to create a slicer based of the distinct ingredients in the 'Distinct Ingredients' table, which searches the records in the 'Ingredients List' table and reflects the data of the 'Ingredients List' table if it's found.

 

For example, here is the slicer of my 'Distinct Ingredients' table:

When I click on the 'Vegetable' option, only the [Vegetable];[Chicken] record should appear in my table visualization.

 

I've been trying to use only DAX queries to get this out, but am unable to do so. Would appreciate help from the Power BI community experts on this matter! If you have any solutions on how to do this, please guide me along! Thank you!

 

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Bryan1908 

    You can create a measure

    Measure = var a=COUNTROWS(FILTER(VALUES('Distinct Ingredients'[Column1]),CONTAINSSTRING(SELECTEDVALUE('Ingredients List'[Column1]),[Column1])))
    return IF(a>0,1,0)

    Then put the measure to the table visual filter

     

    Output

     

    Best Regards!

    Yolo Zhu

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