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 August 31st. Request your voucher.

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

Share with Power BI Enthusiasts: 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

Share with Power BI Enthusiasts: 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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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