Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Slicer capabilities with multiple text items in column

Hello community,

 

I have a problem that I'm sure is not unique but I have not been able to find help and I've spent way too much time trying to figure this out for myself. 

 

I have a dataset that includes project management information, each project has a number with various things relating to that project. However, this data set contains bi weekly updates of the projects, so each entry has an index number and a list date (when the information was updated). 

 

Dataset structure

 

The issue is with the LOB column. Projects are allowed to have several LOBs associated with the project, but the combinations should not be an option in a slicer (see below). For example, when someone wants to slice the data based on G on the most recent date, rows 6( F,G,H) ,8 (I,G) ,and 10 (F,G,H) should all show up. 

 

 

I have tried several different versions of the CONTAINS function with no success, currently the dataset is running based on the first LOB that shows up in the cell (meaning if a combination starts with F, that combination will only show up when the slicer is a F). 

In similar situations I've extracted the values based on a delimiter and unpivoted the columns, but that doesn't work in this case because we cannot have duplicate index values and we don't know how long these combinations can be. My hunch is that there's a way this can be done with a combination of the CONTAINS and IF function but my DAX skills are not that advanced.

 

 

This community has been very helpful to me in the past so thank you in advance for helping me.

  • Hi Anonymous ,

     

    Please check:

     

    1. You can use a custom visual -- "Text Filter".

     

    2. Or, you can create a measure and then use it as a filter.

    Measure = 
    VAR SelectedOption =
        SELECTEDVALUE( 'Slicer Table'[Slicer Options] )
    RETURN
        IF ( SEARCH ( SelectedOption, MAX ( 'Table'[LOB] ),, BLANK () ) <> BLANK (), 1 )
    

    BTW, .pbix file attached.

     

     

    Best Regards,

    Icey

     

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

4 Replies

  • Icey's avatar
    Icey
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    Please check:

     

    1. You can use a custom visual -- "Text Filter".

     

    2. Or, you can create a measure and then use it as a filter.

    Measure = 
    VAR SelectedOption =
        SELECTEDVALUE( 'Slicer Table'[Slicer Options] )
    RETURN
        IF ( SEARCH ( SelectedOption, MAX ( 'Table'[LOB] ),, BLANK () ) <> BLANK (), 1 )
    

    BTW, .pbix file attached.

     

     

    Best Regards,

    Icey

     

    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

      Thank you SO much! I used the measure option because I had to provide the options instead of hoping the user would know with the text box. Your post was extremely helpful and worked perfectly- the gifs really helped! 

  • Anonymous the best option would be to split the column in power query and then use it for the slicer, share the pbix file with sample data and I can get you the solution.

    • Anonymous's avatar
      Anonymous
      Not applicable

      parry2k  I've put the link in the original post.