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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
FoadTanbour
Regular Visitor

Filtering table with slicer selection

Hello All, I am trying to filter a table (or build a dynamic table or a summarized table) with multiple values from a slicer.  I have collected the slicer selections into a string like this "F", "M" and then in DAX added

filter(Grades,Grades[Gender] in {[List of Gender values]})
Of course because my measure is just a string concatenation of the slicer selections and not a table or list, it does not work 😞
Thank you
===================
Here's my code:
New Grades Table =
var GenderFilter = filter(Grades,Grades[Gender] in {[List of Gender values]})
return
CALCULATETABLE(Grades, GenderFilter)
 
and the list measure:
List of Gender values = var z =
        CONCATENATE(CONCATENATE("""",
        CONCATENATEX(VALUES('Grades'[Gender]),          'Grades'[Gender], """, """, 'Grades'[Gender],    ASC    )
        ), """")
            return z
2 REPLIES 2
FreemanZ
Super User
Super User

hi @FoadTanbour 

The content of a post shall be dominated by sample data and expected result, instead others. 

Hello @FreemanZ  and thanks so much for your prompt response.

Pls see here for pbix and data and notice that when you select student, it filters the grades table but not the the Grades Summary.

Of course this example is a simplified version of what I am looking for, which is to be able to include the selected student id from a visual or slicer in the Summarize  command as a filter, however, if I collect the selected student id's and concatenate them, the filter "in" command does not accept them because they are a string and it is expecting a table.

 

https://drive.google.com/drive/folders/16ara2LXEQaoposEGcIMS9VbNhlqj0eIN?usp=share_link

 

Thanks so much

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.