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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Choose between measures in a slicer

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?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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"))

9.PNG

 

 

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.

10.PNG

 

Result:

11.PNG

 

Regards,

Xiaoxin Sheng

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

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"))

9.PNG

 

 

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.

10.PNG

 

Result:

11.PNG

 

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?

Anonymous
Not applicable

Go to "Modeling"

image.png

 

Select "New Table"

image.png

 

Copy / paste the text into the DAX code line

image.png

 

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.

Anonymous
Not applicable

 
Anonymous
Not applicable

FANTASTIC!!! Works very well. Thank you very much!

fhill
Resident Rockstar
Resident Rockstar

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




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




Anonymous
Not applicable

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

Anonymous
Not applicable

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?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors