Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi
My matrix is showing a country's exports and it has calendar years in the columns and export products in the rows. I can use export dollar values and volumes (in tonnes) as the Matrix Values but want to use slicer which will allow me show either the dollar values or the tonnes but not the both. Is it possible to create such a slicer/filter?
Solved! Go to Solution.
Hi @M-Sayeed -Yes, it is possible to create a slicer in Power BI that allows you to toggle between two measures, such as export dollar values and volumes in tonnes, and display only one in your matrix.
You can do this by creating a "Measure Selector" with a disconnected table and some DAX logic.
Create a new table with the names of the two options you'd like to toggle between (e.g., "Dollar Values" and "Tonnes").
You could name this table something like Measure Selector.
Go to Modeling > New Measure and create a measure that uses SWITCH and SELECTEDVALUE to toggle between the dollar values and tonnes
Selected Measure =
SWITCH(
SELECTEDVALUE('Measure Selector'[Measure]),
"Dollar Values", SUM('ExportData'[Dollar Values]),
"Tonnes", SUM('ExportData'[Tonnes])
)
Drag the Measure field from the Measure Selector table to the slicer.This will allow users to toggle between "Dollar Values" and "Tonnes".
hope this helps
Proud to be a Super User! | |
Hi, @M-Sayeed
Based on your information, I create a sample table:
Then create a new table:
SlicerTable = DATATABLE(
"Option", STRING,
{
{"Dollar Values"},
{"Volumes"}
}
)
Create a new measure, and put the Option column in slicer view. Put measure in matrix visual:
SelectedValue =
SWITCH(
SELECTEDVALUE('SlicerTable'[Option]),
"Dollar Values", SUM('Table'[DollarValue]),
"Volumes", SUM('Table'[Volume (Tonnes)])
)
Here is my preview:
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @M-Sayeed
Based on your information, I create a sample table:
Then create a new table:
SlicerTable = DATATABLE(
"Option", STRING,
{
{"Dollar Values"},
{"Volumes"}
}
)
Create a new measure, and put the Option column in slicer view. Put measure in matrix visual:
SelectedValue =
SWITCH(
SELECTEDVALUE('SlicerTable'[Option]),
"Dollar Values", SUM('Table'[DollarValue]),
"Volumes", SUM('Table'[Volume (Tonnes)])
)
Here is my preview:
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It worked for me perfectly. Thanks a lot, mate.
Hi @M-Sayeed -Yes, it is possible to create a slicer in Power BI that allows you to toggle between two measures, such as export dollar values and volumes in tonnes, and display only one in your matrix.
You can do this by creating a "Measure Selector" with a disconnected table and some DAX logic.
Create a new table with the names of the two options you'd like to toggle between (e.g., "Dollar Values" and "Tonnes").
You could name this table something like Measure Selector.
Go to Modeling > New Measure and create a measure that uses SWITCH and SELECTEDVALUE to toggle between the dollar values and tonnes
Selected Measure =
SWITCH(
SELECTEDVALUE('Measure Selector'[Measure]),
"Dollar Values", SUM('ExportData'[Dollar Values]),
"Tonnes", SUM('ExportData'[Tonnes])
)
Drag the Measure field from the Measure Selector table to the slicer.This will allow users to toggle between "Dollar Values" and "Tonnes".
hope this helps
Proud to be a Super User! | |
Very helpful. Thanks a lot, mate.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.