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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Rondel
Frequent Visitor

Filtering a Table based on two non-interacting slicers

Hello,

 

Is it possible to perform the following?

 

Dataset sample:

NameLetterNumber
Test1A1
Test2A1
Test3B3
Test4C2
Test5C4
Test6D5
Test7E6
Test8E7

 

***The request is such that when they filter the 'Letter' slicer = 'A' and 'Number' slicer = '7', they should see:

 

Expected Results:

NameLetterNumber
Test1A1
Test2A1
Test8E7

 

Is this possible?

5 REPLIES 5
v-yangliu-msft
Community Support
Community Support

Hi  @Rondel ,

 

If you want to consider using multiple selection, you can use the SELECTCOLUMNS() function:

SELECTCOLUMNS function (DAX) - DAX | Microsoft Learn

Flag =
var _select1=SELECTCOLUMNS('Letter_Slicer',"letter",'Letter_Slicer'[Letter])
var _select2=SELECTCOLUMNS('Number_Slicer',"number",'Number_Slicer'[Number])
return
IF(
    MAX('Table'[Letter]) IN _select1 || MAX('Table'[Number]) in _select2,1,0)

 

vyangliumsft_0-1709007950793.png

 

Best Regards,

Liu Yang

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

Hi @v-yangliu-msft ,

 

Seems that the filter doesn't work when doing multiple selection on just one of the columns:

Rondel_0-1709047123150.png

 

lbendlin
Super User
Super User

You need to normalize these columns into their own dimension tables and then feed the slicers from those.

 

If you want to implement an "OR"  logic you need to do that via measures, and use the measures as visual filters.

v-yangliu-msft
Community Support
Community Support

Hi  @Rondel ,

 

 

Here are the steps you can follow:

1. Create calculated table.

Letter_Slicer =
 DISTINCT('Table'[Letter])
Number_Slicer =
DISTINCT('Table'[Number])

2. Create measure.

Flag =
var _select1=SELECTEDVALUE('Letter_Slicer'[Letter])
var _select2=SELECTEDVALUE('Number_Slicer'[Number])
return
IF(
    MAX('Table'[Letter]) = _select1 || MAX('Table'[Number]) = _select2,1,0)

3. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_0-1708997195631.png

4. Result:

vyangliumsft_1-1708997195634.png

 

Best Regards,

Liu Yang

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

Thank you so much! 

How should I go about it if multi-selection was needed for the [Letter] or [Number] column?  Seems to not be able to work when trying multi-selection.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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