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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
JFG123
Frequent Visitor

Filter table based on slicer with multiselect for a column with combinations

I am trying to filter the data table in power bi reports where if I select A and B in the drop-down, the data table in report view keeps all rows that have A AND B in them. Ie it would only keep the first row where the combination is A,B,C

 

JFG123_0-1643696408279.png

 

2 ACCEPTED SOLUTIONS
v-luwang-msft
Community Support
Community Support

Hi @JFG123 ,

The way Samarth_18 shared ,only  suitable for cases where the slicer selects only one value.When your slicer selects more than one value, an error will be reported.You could try the following ways.

Output:

vluwangmsft_0-1645600699298.pngvluwangmsft_1-1645600705832.pngvluwangmsft_2-1645600718032.png

 

Solutions:

Use the following dax to create new column:

first = LEFT(Data[Combination],1)
second = MID(Data[Combination],3,1)
third = RIGHT(Data[Combination])

vluwangmsft_3-1645600773671.png

 

Then base on the base table ,create another table:

Table = 
UNION (
    SELECTCOLUMNS (
        Data,
        "Drop Down", Data[first],
        "Combination", Data[Combination],
        "value", Data[Value]
    ),
    SELECTCOLUMNS (
        Data,
        "Drop Down", Data[second],
        "Combination", Data[Combination],
        "value", Data[Value]
    ),
    SELECTCOLUMNS (
        Data,
        "Drop Down", Data[third],
        "Combination", Data[Combination],
        "value", Data[Value]
    )
)

Final create visual:

vluwangmsft_4-1645600848620.png

 

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

View solution in original post

Hi @JFG123 ,

It need to adjust on my before pbix file.

Output refer:

vluwangmsft_0-1646379402521.pngvluwangmsft_1-1646379409032.png

vluwangmsft_4-1646379443072.png

Measure:

Measure1 = CALCULATE(DISTINCTCOUNT('Table'[Drop Down]), ALLSELECTED('Table'))
Measure2 = CALCULATE(COUNTROWS('Table'), ALLSELECTED('Table'),'Table'[Combination]=MAX('Table'[Combination]))
Measure3 = IF([Measure2]>=[Measure1],1,BLANK())

 

vluwangmsft_5-1646379523837.png

 

You could download my pbix file  and refer it.

 

 

 

Best Regards

Lucien

 

 

 

View solution in original post

7 REPLIES 7
v-luwang-msft
Community Support
Community Support

Hi @JFG123 ,

The way Samarth_18 shared ,only  suitable for cases where the slicer selects only one value.When your slicer selects more than one value, an error will be reported.You could try the following ways.

Output:

vluwangmsft_0-1645600699298.pngvluwangmsft_1-1645600705832.pngvluwangmsft_2-1645600718032.png

 

Solutions:

Use the following dax to create new column:

first = LEFT(Data[Combination],1)
second = MID(Data[Combination],3,1)
third = RIGHT(Data[Combination])

vluwangmsft_3-1645600773671.png

 

Then base on the base table ,create another table:

Table = 
UNION (
    SELECTCOLUMNS (
        Data,
        "Drop Down", Data[first],
        "Combination", Data[Combination],
        "value", Data[Value]
    ),
    SELECTCOLUMNS (
        Data,
        "Drop Down", Data[second],
        "Combination", Data[Combination],
        "value", Data[Value]
    ),
    SELECTCOLUMNS (
        Data,
        "Drop Down", Data[third],
        "Combination", Data[Combination],
        "value", Data[Value]
    )
)

Final create visual:

vluwangmsft_4-1645600848620.png

 

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

This soln almost answers the question (so close...), this soln does A OR B filtering, I want A AND B when filtering as stated in OP. Is there anyway to modify yours or @Samarth_18 post to get the AND functionality with multiple selections?

Hi @JFG123 ,

It need to adjust on my before pbix file.

Output refer:

vluwangmsft_0-1646379402521.pngvluwangmsft_1-1646379409032.png

vluwangmsft_4-1646379443072.png

Measure:

Measure1 = CALCULATE(DISTINCTCOUNT('Table'[Drop Down]), ALLSELECTED('Table'))
Measure2 = CALCULATE(COUNTROWS('Table'), ALLSELECTED('Table'),'Table'[Combination]=MAX('Table'[Combination]))
Measure3 = IF([Measure2]>=[Measure1],1,BLANK())

 

vluwangmsft_5-1646379523837.png

 

You could download my pbix file  and refer it.

 

 

 

Best Regards

Lucien

 

 

 

Awesome!

Samarth_18
Community Champion
Community Champion

Hi @JFG123 ,

 

You can create a measure like below and use it as filter on your table visual.

_filter =
VAR selected_value =
    SELECTEDVALUE ( Drop_down[Filter_value] )
RETURN
    IF ( CONTAINSSTRING ( MAX ( Data[Comb Value] ), selected_value ), 1, 0 )

 

Output:-

Samarth_18_0-1643697220518.png

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Can you please provide the sample pbix for your solution 🙂

@JFG123 Please refer below URL:-

https://we.tl/t-4aRstxkzbu

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.