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

Top Solution Authors