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
ironboy0418
Helper II
Helper II

How to reference slicer from another based on user selection using switch in dax?

Hello, I am trying to reference a date column to a slicer. First, I have created a query table that has this selection/values:

ironboy0418_0-1679006790274.png

Slicer 1:

ironboy0418_2-1679006895862.png

The objective is when I selected a value in slicer 1, the selection should update in slicer 2. Here are the example options for Quarterly, Monthly, and Weekly from my date table that I am trying to reference with:

 

Quarterly:

ironboy0418_7-1679007156963.png

 

 

Monthly:

ironboy0418_6-1679007150489.png

 

 

Weekly:

ironboy0418_5-1679007139764.png

 

Here is my dax formula. However, I am not sure how to write for it to be referenced using switch:

RelativePeriodSelection =
VAR SelectYearQuarter = SELECTEDVALUE('Date'[YearQuarter])
VAR SelectYearMonth = SELECTEDVALUE('Date'[YearMonth2])
VAR SelectWeekStart = SELECTEDVALUE('Date'[Start of Week])

VAR DynamicDateValue =
    SWITCH (SELECTEDVALUE(Period[RelativeDate]), "Quarterly", SelectYearQuarter, "Monthly", SelectYearMonth, "Weekly", SelectWeekStart

    )
RETURN
DynamicDateValue
 
ironboy0418_0-1679015909829.png

 

Result:

ironboy0418_1-1679015926959.png

 

cc @tamerj1 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ironboy0418 I think this may help, the field parameter feature, You may have rename your columns

Power BI- Create dynamic slicers using field parameters: https://youtu.be/H2ZxWaHAJZQ

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@ironboy0418 I think this may help, the field parameter feature, You may have rename your columns

Power BI- Create dynamic slicers using field parameters: https://youtu.be/H2ZxWaHAJZQ

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for this! @amitchandak I didn't realize that there is an option for this 🙂 great!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.

Top Solution Authors