Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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
id | gender | age |
a | m | 23 |
b | m | 23 |
c | f | 22 |
d | t | 20 |
e | f | 20 |
I want to make a slicer with the values based on both gender and age column
E.g
When i clicked on the slicer value it should filter the above table
Thanks
Solved! Go to Solution.
Hi @BIswajit_Das ,
Here are the steps you can follow:
1. In Power Query , copy the Table.
Table(2):
Select [age] and [id] – Home – Remove Columns.
Right-click the mouse -- Remove Duplicates:
Table(3):
Select [gender] and [id] – Home – Remove Columns.
Right-click the mouse -- Remove Duplicates:
Table(3):
Select [gender] and [id] – Home – Remove Columns.
Right-click the mouse -- Remove Duplicates:
2. Home – Append Queries -- Append Queries as new .
Select both [gender] and [age] -- Right-click the mouse – Merge Columns.
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.
5. Result:
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 @BIswajit_Das ,
Here are the steps you can follow:
1. In Power Query , copy the Table.
Table(2):
Select [age] and [id] – Home – Remove Columns.
Right-click the mouse -- Remove Duplicates:
Table(3):
Select [gender] and [id] – Home – Remove Columns.
Right-click the mouse -- Remove Duplicates:
Table(3):
Select [gender] and [id] – Home – Remove Columns.
Right-click the mouse -- Remove Duplicates:
2. Home – Append Queries -- Append Queries as new .
Select both [gender] and [age] -- Right-click the mouse – Merge Columns.
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.
5. Result:
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
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
you could use a nested slicer, or simply utilize two slicers: one for gender another for age.
I think that the maximum you can achieve is a nested slicer (if you only want one slicer):
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
89 | |
86 | |
82 | |
64 | |
49 |
User | Count |
---|---|
125 | |
111 | |
88 | |
69 | |
66 |