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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
BIswajit_Das
Resolver III
Resolver III

Power BI Slicer

Hello team need to figure out a way to use values from 2 columns used as slicer options in a slicer
Here used table is

idgenderage
am23
bm23
cf22
dt20
ef20

I want to make a slicer with the values based on both gender and age column
E.g

s1.PNG

When i clicked on the slicer value it should filter the above table
Thanks

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @BIswajit_Das ,

 

Here are the steps you can follow:

1. In Power Query , copy the Table.

vyangliumsft_0-1689907110699.png

Table(2):

Select [age] and [id] – Home – Remove Columns.

vyangliumsft_1-1689907110703.png

Right-click the mouse -- Remove Duplicates:

vyangliumsft_2-1689907125142.png
vyangliumsft_3-1689907125143.png

Table(3):

Select [gender] and [id] – Home – Remove Columns.

vyangliumsft_4-1689907140499.png

Right-click the mouse -- Remove Duplicates:

vyangliumsft_5-1689907140499.png

Table(3):

Select [gender] and [id] – Home – Remove Columns.

vyangliumsft_6-1689907155277.png

Right-click the mouse -- Remove Duplicates:

vyangliumsft_7-1689907155277.png

2. Home – Append Queries -- Append Queries as new .

vyangliumsft_8-1689907214477.png

Select both [gender] and [age] -- Right-click the mouse – Merge Columns.

vyangliumsft_9-1689907214477.png

3. Create measure.

Measure =
var _select=SELECTEDVALUE('Append1'[Merged])
return
IF(
    _select in SELECTCOLUMNS('Table',"age",CONVERT('Table'[age],STRING)) || _select in SELECTCOLUMNS('Table',"gender",'Table'[gender]),1,0)

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

vyangliumsft_10-1689907319733.png

5. Result:

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

View solution in original post

7 REPLIES 7
v-yangliu-msft
Community Support
Community Support

Hi  @BIswajit_Das ,

 

Here are the steps you can follow:

1. In Power Query , copy the Table.

vyangliumsft_0-1689907110699.png

Table(2):

Select [age] and [id] – Home – Remove Columns.

vyangliumsft_1-1689907110703.png

Right-click the mouse -- Remove Duplicates:

vyangliumsft_2-1689907125142.png
vyangliumsft_3-1689907125143.png

Table(3):

Select [gender] and [id] – Home – Remove Columns.

vyangliumsft_4-1689907140499.png

Right-click the mouse -- Remove Duplicates:

vyangliumsft_5-1689907140499.png

Table(3):

Select [gender] and [id] – Home – Remove Columns.

vyangliumsft_6-1689907155277.png

Right-click the mouse -- Remove Duplicates:

vyangliumsft_7-1689907155277.png

2. Home – Append Queries -- Append Queries as new .

vyangliumsft_8-1689907214477.png

Select both [gender] and [age] -- Right-click the mouse – Merge Columns.

vyangliumsft_9-1689907214477.png

3. Create measure.

Measure =
var _select=SELECTEDVALUE('Append1'[Merged])
return
IF(
    _select in SELECTCOLUMNS('Table',"age",CONVERT('Table'[age],STRING)) || _select in SELECTCOLUMNS('Table',"gender",'Table'[gender]),1,0)

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

vyangliumsft_10-1689907319733.png

5. Result:

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

BIswajit_Das
Resolver III
Resolver III

Thanks for responding
But I need to use both columns values as options in the slicer as i mentioned on the post

Yes, I know. But Power BI just nests two columns... It doesn't allow multiple columns in a slicer

Isn't there any workaround or any tricks

I don't think so, but... Let's wait and see if anyone knows something

johnyip
Super User
Super User

you could use a nested slicer, or simply utilize two slicers: one for gender another for age.



Please mark my post as the solution if this answers your question!
Appreciate your Kudos !!
mlsx4
Super User
Super User

Hi @BIswajit_Das 

 

I think that the maximum you can achieve is a nested slicer (if you only want one slicer):

 

mlsx4_0-1689751005948.png

 

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.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.