Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

filter table based on selected value using contains

Hi,

I am trying to filter the table in which column of the table contains the selected value(like substring). I am getting the selected value in the card when I select a bin of bar charts and using the same selected value to filter the table but I am getting blank rows.

Here's the bar chart by setting up the filter of Type to T1:

Here's the table data:

 

so if I click any of the bars of the above chart(e.g clicking "A"), I should get the below results:

 

I am trying to achieve this by using the below measure:
If(CONTAINS(MAX(category_table[Category]),SELECTEDVALUE(category_table[Category])),1,0)

After this, I'll set this measure to 1 to filter out the table.
Let me what I need to do here or what I am doing wrong.

amitchandak 

AllisonKennedy

ibarrau 

14 Replies

  • v-zhangti's avatar
    v-zhangti
    Community Support

    Hi, Anonymous 

     

    Please check the following methods.

    Measure = IFERROR(SEARCH(SELECTEDVALUE(Category[Category]),SELECTEDVALUE('Table'[Category])),-1)

    Put Measure in Fliters and set not equal to -1.

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

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

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-zhangti 

      Thank you for your reply. But I don't have any category table. 

      Is it possible to create the category table on the run and then use the above measure?


      • v-zhangti's avatar
        v-zhangti
        Community Support

        Hi, Anonymous 

         

        So where does your A B C D come from?

         

        Best Regards

  • Is the data source for your column chart a disconnected table?

    • Anonymous's avatar
      Anonymous
      Not applicable

      I am using the same data source for both tables.

      • lbendlin's avatar
        lbendlin
        Super User

        Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to work with. Please show the expected outcome based on the sample data you provided.


  • Hi,

    In the Data Table itself, you should have a Master Category column with values of A,B,C and D.  Now create your visual/slicers.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Ashish_Mathur I don't have the Master Column with values of A,B,C,D.

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        So if they are in another table then one can always bring them over into your table by using the RELATED() or LOOKUPVALUE() funcion.