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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
DioLago79
New Member

Toggle data values in a slicer

Hello all!

 

I was wondering if there was a way to toggle which data a slicer pulls. For example, if I have two date columns in a table, is there a way to create a single slicer that can switch between those two data sources and not have them concurrently displayed?

 

If that's not possible, is there a way to make it LOOK like that is what's happening?

 

Thank you!

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @DioLago79 

The most direct method to switch the column used on a slicer would be to create a field parameter containing the two possible columns, along with a slicer to select the field parameter value itself.

https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

 

Depending on the model and the nature of the visuals, you could also use a calculation group approach:

https://www.sqlbi.com/articles/using-calculation-groups-to-switch-between-dates/

With this approach, the slicer would use a column from the date table, say 'Date'[Date], but changing the calculation item selection would change the relationship applied when evaluating measures.

 

Would either of these methods work for you?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

4 REPLIES 4
danextian
Super User
Super User

Hi @DioLago79 

 

You can use field parameters to switch between different columns, but when used in a slicer, the selection isn't retained during switching. If the dataset isn't too large and involves only a single query, consider adding an index column to that query. Then reference it, remove unnecessary columns, and keep only the index and date columns. Unpivot the remaining columns based on the index. After that, create a many-to-many single-direction relationship from the index column in the unpivoted table to the index column in the fact table.

danextian_0-1747208139631.gif

 

Please see the attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
maruthisp
Super User
Super User

Hi DioLago79,
As per my understanding, slicer can't switch between two columns. I tried some workaround to implement the same logic by using DAX.
Please find the attached pbix file with sample data and DAX expressions to achieve the same.
Toggle data values in a slicer.pbix

If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated — thanks! 

 

Best Regards, 

Maruthi 

LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/ 

X            -  Maruthi Siva Prasad - (@MaruthiSP) / X

OwenAuger
Super User
Super User

Hi @DioLago79 

The most direct method to switch the column used on a slicer would be to create a field parameter containing the two possible columns, along with a slicer to select the field parameter value itself.

https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

 

Depending on the model and the nature of the visuals, you could also use a calculation group approach:

https://www.sqlbi.com/articles/using-calculation-groups-to-switch-between-dates/

With this approach, the slicer would use a column from the date table, say 'Date'[Date], but changing the calculation item selection would change the relationship applied when evaluating measures.

 

Would either of these methods work for you?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Thank you for the succinct response! I ended up using the parameter approach in my scenario, after going through all of the answers I got. It was the easiest in my opinion.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.