Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
In a table, I have sales in Value, Volume and Units in different columns. In the table and/or chart, I would like to be able to choose if I want to see Value, Volume or Units in a filter of a slicer
Is that possible?
Solved! Go to Solution.
Hi @Anonymous,
You can refer to below steps to achieve your requirement:
1. Create a Selector table as source of slicer.
Selector = UNION(ROW("Type","Amount"),ROW("Type","Value"),ROW("Type","Unit"))
2. Write measure to original table to choose display item based on slicer.
Dynamic Display =
var selectitem=IF(HASONEVALUE(Selector[Type]),VALUES(Selector[Type]),BLANK())
return
SWITCH(selectitem,"Amount",MAX('Table'[Amount]),"Unit",MAX('Table'[Unit]),"Value",MAX('Table'[Value]),BLANK())
3. Create table visual and slicer.
Result:
Regards,
Xiaoxin Sheng
Hi @Anonymous,
You can refer to below steps to achieve your requirement:
1. Create a Selector table as source of slicer.
Selector = UNION(ROW("Type","Amount"),ROW("Type","Value"),ROW("Type","Unit"))
2. Write measure to original table to choose display item based on slicer.
Dynamic Display =
var selectitem=IF(HASONEVALUE(Selector[Type]),VALUES(Selector[Type]),BLANK())
return
SWITCH(selectitem,"Amount",MAX('Table'[Amount]),"Unit",MAX('Table'[Unit]),"Value",MAX('Table'[Value]),BLANK())
3. Create table visual and slicer.
Result:
Regards,
Xiaoxin Sheng
Great and useful answer, thanks.
how would you then make the column header displays the name of the slicer selection?
How do you create the "Type" table that the selector table is referencing?
Go to "Modeling"
Select "New Table"
Copy / paste the text into the DAX code line
Change the code as needed and press enter... You can add more lines in the table later
Thank you - I have figured out another method.
FANTASTIC!!! Works very well. Thank you very much!
I watched this training recently, and I belive they are doing something simular to what you are asking. They use a slicer to choose between 3 values on a line chart.
http://pragmaticworks.com/Training/Details/Advanced-DAX-Problem-Design-Solution
Forrest
Proud to give back to the community!
Thank You!
Hi Fhill,
This also a good alternative - and will use this as well as it works well with measures. One issue though is that in tables the measures will still be in the table columns when it is deselected - just with no values, If one have a lot of measueres that dose not work very well.
- But it charts it's perfect!
Kent
Hi,
In a table, I have sales in Value, Volume and Units in different columns. In the table and/or chart, I would like to be able to choose if I want to see Value, Volume or Units in a filter of a slicer
Is that possible?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.