Forum Discussion

sutmar's avatar
sutmar
Frequent Visitor
8 years ago
Solved

Show items with text field based on selected text

I have a list of Projects in a table [Projects] with a column [DSF] containing text. I created another table [Select] with a Column listing words that shall be used as a filter. I would like to diaply all Projects that contain selected word in column [DSF]. Until now I have failed to achieve this and would appreciate suggestions. 

  • sutmar

     

    You can create two measures with following DAX formula, one to return the selected text, another one to mark the filtered rows.

    For details, please refer to attached PBIX file.

     

    SelectedString = 
    IF (
        ISFILTERED ( Table2[DSF_Select] ),
        SELECTEDVALUE (
            Table2[DSF_Select],
            CONCATENATEX ( Table2, Table2[DSF_Select], ", " )
        ),
        "Not Select"
    )
    
    Mark = 
    SEARCH ( [SelectedString], CALCULATE ( MAX ( Table1[DSF] ) ), 1, -1 )
    

    Drag the Mark measure to visual level filter of the Table visual as following screenshot, set it greater than 0.

     

     

    Best Regards,
    Herbert

8 Replies

  • v-haibl-msft's avatar
    v-haibl-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    sutmar

     

    You can create two measures with following DAX formula, one to return the selected text, another one to mark the filtered rows.

    For details, please refer to attached PBIX file.

     

    SelectedString = 
    IF (
        ISFILTERED ( Table2[DSF_Select] ),
        SELECTEDVALUE (
            Table2[DSF_Select],
            CONCATENATEX ( Table2, Table2[DSF_Select], ", " )
        ),
        "Not Select"
    )
    
    Mark = 
    SEARCH ( [SelectedString], CALCULATE ( MAX ( Table1[DSF] ) ), 1, -1 )
    

    Drag the Mark measure to visual level filter of the Table visual as following screenshot, set it greater than 0.

     

     

    Best Regards,
    Herbert

    • sutmar's avatar
      sutmar
      Frequent Visitor

      v-haibl-msft

       

      Fantastic! Thank you so much, that is it! :-) Very much appreciated!

    • sutmar's avatar
      sutmar
      Frequent Visitor

      v-haibl-msft

       

      Could the setting be adapted that I see all the projects if no value is selected? And would it possible to allow multiple filter values?

  • Hi,

     

    Try this calculated column formula in Table1

     

    =FIRSTNONBLANK(FILTER(VALUES(Table2[Keywords]),SEARCH(Table2[Keywords],Table1[DSF],1,0)),1)

     

    • sutmar's avatar
      sutmar
      Frequent Visitor

      Thank you very much, but it is not what I am trying to achieve. Please see picture to visualize what I try to do with BI Desktop.

      Table one should only display those items containing the words in DSF that I have selected in DSF_Select Slicer.

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        Hi,

         

        I am still not clear.  Show me your raw data, your filter criteria and your expected result.