Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |