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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply

Slicer Issue

Hi every one ,

Im working on this same issue , Solved: Re: Single slicer for multiple values in row - Microsoft Fabric Community

community.fabric.microsoft.com/t5/Desktop/Single-slicer-for-multiple-values-in-row/m-p/2006104#M7555...

 

but the solution with below DAX is not working , im stuck can anyone help me please!

 

_Filter = 
IF (
    CONTAINSSTRING (
        MAX ( 'Beer Data'[Type] ),
        SELECTEDVALUE ( 'Beer Data_duplicate'[Type] )
    ),
    1,
    0
)

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @faheem_Latif_BI 

Based on your description, I have created these sample data below:

vjianpengmsft_0-1721872618542.png

First, we need to go inside PowerQuery and extract our type, removing the symbols:

vjianpengmsft_1-1721872730748.png

Open the PowerQuery Advanced Editor and use the following M code:

vjianpengmsft_5-1721873538622.png

 

SplitColumn = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"Type", Splitter.SplitTextByDelimiter(";#", QuoteStyle.Csv), type text}}), "Type"),
    #"Removed Duplicates" = Table.Distinct(SplitColumn)

Note that you changed #“Changed Type” to the name of the step you took in the previous step:

vjianpengmsft_4-1721873505600.png

Get the table below:

vjianpengmsft_6-1721873587561.png

Close and apply:

vjianpengmsft_7-1721873624078.png

Use the following DAX expression to create a new measure in Power BI:

Filter = 
VAR _table1 = SELECTCOLUMNS('Table','Table'[Type])
VAR _table2 = SELECTCOLUMNS('Table (2)','Table (2)'[Type])
VAR _table3 = FILTER(ADDCOLUMNS(CROSSJOIN(_table1,_table2),"contain?",IF(FIND('Table (2)'[Type],'Table'[Type],1
    ,0)<>0,1,0)),[contain?]=1)
VAR _current_row = SELECTEDVALUE('Table'[Type])
RETURN MAXX(FILTER(_table3,'Table'[Type]=_current_row),[contain?])

Create a new slicer using the type column of Table (2):

vjianpengmsft_8-1721873726363.png

Use the table table to create a new visual object and in the filter panel, place the measure at the visual  level:

vjianpengmsft_11-1721874597436.png

 

The results are as follows:

vjianpengmsft_10-1721873835746.png

vjianpengmsft_12-1721874650314.png

vjianpengmsft_13-1721874664328.png

I have provided the PBIX file used in this instance below.

 

 

Best Regards

Jianpeng Li

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

1 REPLY 1
Anonymous
Not applicable

Hi, @faheem_Latif_BI 

Based on your description, I have created these sample data below:

vjianpengmsft_0-1721872618542.png

First, we need to go inside PowerQuery and extract our type, removing the symbols:

vjianpengmsft_1-1721872730748.png

Open the PowerQuery Advanced Editor and use the following M code:

vjianpengmsft_5-1721873538622.png

 

SplitColumn = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"Type", Splitter.SplitTextByDelimiter(";#", QuoteStyle.Csv), type text}}), "Type"),
    #"Removed Duplicates" = Table.Distinct(SplitColumn)

Note that you changed #“Changed Type” to the name of the step you took in the previous step:

vjianpengmsft_4-1721873505600.png

Get the table below:

vjianpengmsft_6-1721873587561.png

Close and apply:

vjianpengmsft_7-1721873624078.png

Use the following DAX expression to create a new measure in Power BI:

Filter = 
VAR _table1 = SELECTCOLUMNS('Table','Table'[Type])
VAR _table2 = SELECTCOLUMNS('Table (2)','Table (2)'[Type])
VAR _table3 = FILTER(ADDCOLUMNS(CROSSJOIN(_table1,_table2),"contain?",IF(FIND('Table (2)'[Type],'Table'[Type],1
    ,0)<>0,1,0)),[contain?]=1)
VAR _current_row = SELECTEDVALUE('Table'[Type])
RETURN MAXX(FILTER(_table3,'Table'[Type]=_current_row),[contain?])

Create a new slicer using the type column of Table (2):

vjianpengmsft_8-1721873726363.png

Use the table table to create a new visual object and in the filter panel, place the measure at the visual  level:

vjianpengmsft_11-1721874597436.png

 

The results are as follows:

vjianpengmsft_10-1721873835746.png

vjianpengmsft_12-1721874650314.png

vjianpengmsft_13-1721874664328.png

I have provided the PBIX file used in this instance below.

 

 

Best Regards

Jianpeng Li

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

 

 

 

 

 

 

 

 

 

 

 

 

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.