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
jdg_librarian
New Member

Use a slicer to filter from a list in a cell

Hi, all,

I'm a librarian trying to get some insight from our programming data. The way our staff inputs our programming data, it can have multiple age groups in one cell (Elementary, Middle School, High School, etc.)

 

What I would like to do is have a slicer that, if they select Elementary, it pulls all the attendance data (from the measure Attendance Total which adds the columns AttendanceChildren, AttendanceTeens, and AttendanceAdults) from all the rows that have Elementary anywhere in the Age Group column. So it could be Elementary all by itself (which I can do), or Elementary High School, or Elementary Adults. I have a table with my age groups, so I can get the slicer to do what I want, and I've linked the age group table with the programming group table, but it is still pulling ONLY programs that have Elementary.

I've tried adding columns in my data table that have Yes if Elementary is found anywhere in the cell, but I'm struggling with how to get it to show up. I'd appreciate any suggestions, with the caveat that I haven't had a lot of formal Power BI training and am basically learning through a combination of experimentation and looking at other folks' code. Thanks!

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @jdg_librarian 

 

Not sure what your expected result should be like. If you want to show data that has the group selected in the slicer, you can create a measure like below and use it as a filter on the visual. When set it to show items when the value is 1, it only shows items whose AgeGroup contains the selected group. 

Measure = IF(CONTAINSSTRING(SELECTEDVALUE('Table'[AgeGroup]),SELECTEDVALUE('Age Groups'[Group])),1,0)

vjingzhang_1-1685420596978.png

I have attached a sample file at bottom. Let me know if you have any questions. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

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.