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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
tina345
Helper II
Helper II

Slicer based on another Slicer

I have this data set with sales and purchase date.

1st slicer has date_type, what I am trying is based on what user select on date_type, create another slicer with those dates for users to filter data additionally.

 

I have tried different steps and used selected_value DAT to identify what is selected however while applying DAX it doesnt working.

Sales date selection is ok, however if I switch to purchase_date, it still picks sales_date.Any direction/help would be appreciated.

 

tina345_2-1713933294467.png

 

 

 

tina345_1-1713933118385.png 

Data Set 1:

date_type
sales_date
purchase_date

 

Data Set 2:

idsales_datepurchase_dateamount
11/1/20232/1/2023100
21/2/20232/2/2023105
31/3/20232/3/2023110
41/4/20232/4/2023115
51/5/20232/5/2023120
61/6/20232/6/2023125

 

slicer_Date =
     if( SELECTEDVALUE(Sheet1[date_type]) = "purchase_date" , Sheet2[purchase_date] , Sheet2[sales_date] )
   
     // if( SELECTEDVALUE(Sheet1[date_type]) = "purchase_date" , Sheet2[purchase_date] ,
     // if (SELECTEDVALUE(Sheet1[date_type]) = "sales_date" , Sheet2[sales_date]))))
 
 
tina345_0-1713933114231.png

 

Thanks

2 REPLIES 2
Uzi2019
Super User
Super User

Hi @tina345 

You have created disconnected table. If you want your selection to be dynamic then do field parameter values.

 

I have taken similar view of your model just ncolumn name is different.

 

when user select date6 from slicer then date range should be change . I have also shared the table so that you can easily understand.

 

Uzi2019_0-1713943776151.png

Now i have selected different date from slicer 

 

 

Uzi2019_2-1713943915292.png

 

Please refer below video fr better understanding!

https://www.youtube.com/watch?v=-nqEv2YXLsU

 

Note: 
If you take same value in both slicer it will not show you as you can see in my screenshot

Uzi2019_4-1713944195347.png

 

For date range slicer please take table then add parameter value then convert your table into slicer value.

 

if you directly take parameter value in slicer then will show you like this

Uzi2019_5-1713944289697.png

 

so take table visual then add paramter value in it.

Uzi2019_6-1713944351807.png

 

 then convert your table into slicer visual

 

Uzi2019_7-1713944397006.png

 

 

See you will see the desired result.

 

I hope I answered your question!

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
AMeyersen
Resolver I
Resolver I

You can do this using field parameters.

 

  1. Enable preview feature field parameters
  2. create a new field parameter containing your two date columns
  3. copy the auto-created slicer
  4. on the second slicer, select "Show values of selected fields"


There is a detailed explaination in this video
https://www.youtube.com/watch?v=2vqVTAfqrfg

 

 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.