Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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 structureDataset 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. 

 

Capture1.PNG

 

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.

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Please check:

 

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

TEXT filter.gif

 

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 )

measure filter.gif

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.

View solution in original post

4 REPLIES 4
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Please check:

 

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

TEXT filter.gif

 

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 )

measure filter.gif

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
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! 

parry2k
Super User
Super User

@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.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.