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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
aallman
Helper I
Helper I

Toggle between columns used in a date slicer

Hello hopefully this is pretty straightforward.

I am wondering if it is possible to have a date slicer on my page, but allow the user to toggle between two dates. For example, I have order date and due date. I want to have just one date slicer on the page, but allow the user to select "Order Date" or "Due Date" from another slicer. Based on their selection, I want the date slicer to use the appropriate date field. Is that possible? I have looked into a slicer table and then a measure, but in the measure I am not sure how to return the date values to use in a slicer, only to return calculated values such as counts and totals.

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @aallman 

I would recommend using the method described here:

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

This article includes a video and sample files.

 

In your case, this method would involve:

  • Date table with one active relationship and one inactive relationship with your fact table (on the Order Date and Due Date columns).
  • Calculation group with two calculation items named corresponding to these two dates, that allows selection of which relationship to activate.
  • Slicer to select between the calculation items.

With this method, the 'Date'[Date] columnis always used on the Date slicer, but the column that it has an active relationship with is switched using the calculation group.

 

Does something like this work for you? Please post back with more detail if needed.

 

P.S. Field parameters are another option for switching the column used in a slicer or an other visual, but I would say that the calculation group makes better sense from a modelling point of view in this case.


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

View solution in original post

1 REPLY 1
OwenAuger
Super User
Super User

Hi @aallman 

I would recommend using the method described here:

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

This article includes a video and sample files.

 

In your case, this method would involve:

  • Date table with one active relationship and one inactive relationship with your fact table (on the Order Date and Due Date columns).
  • Calculation group with two calculation items named corresponding to these two dates, that allows selection of which relationship to activate.
  • Slicer to select between the calculation items.

With this method, the 'Date'[Date] columnis always used on the Date slicer, but the column that it has an active relationship with is switched using the calculation group.

 

Does something like this work for you? Please post back with more detail if needed.

 

P.S. Field parameters are another option for switching the column used in a slicer or an other visual, but I would say that the calculation group makes better sense from a modelling point of view in this case.


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

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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