cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mehul26
Helper I
Helper I

Dynamic Default value on slicer based on selected value

 

I have two slicers, Year and Quarter.  The Year slicer has 'Current Year' and 'Last Year'.  The quarter slicer has Year_Quarter.  I want the quarter slicer to dynamically change based on the year selected.  If Current Year is selected, then selected 'Current Quarter'.  If Last Year is selected, then select, Previous quarter.  NOTE:  Two slicers are not related and should not be.

 

Here are the assumptions:

  1. Current Year/Last Year slicer is not linked to Quarter slicer (This is by design)
  2. Current Year/Last Year slicer only changes Data 1, Data 2 and Data 3.  It has no impact on Data 4  (This is by design)
  3. Quarter Slicer only changes Data 4 and has no impact to Data 1,2 or 3 (This is by design)

 

Slicers.png

 

 

6 REPLIES 6
mhossain
Super User
Super User

@mehul26 

 

Your screenshot for Quarters is having force Single select option, so once you select anything it can change autoatically the other options, selection click will not get changed automatically.

However the requirement you mentioned above is possible, you can make changes to Quarter slicer so that it's not force selected. And then link year and Quarter slicers to each other and then edit interaction on visuals as you have mentioned above, if quarter should not impact Data1 then edit the interaction between these.

Hope above is making sense.

@mhossain 

I went ahead and changed the Quarter filer so its no longer a single selected.  Do you happen to have a DAX example to the 2nd part?

@mehul26 

1). You can edit the interaction so that there are no interaction between Quarter slicer and Data1,2,3, same for Current Year/last year slicer.   Edit interaction option you will get under 'Format' tab in toolbar pbi desktop.

 

OR

2). In the measures add "ALL" dax   e.g  Calculate (measure name/calculation, All(columnName)) This will ignore the selected column in slicer.

 

Hope above is making sense.

If possible you can share dummy pbix also.

@mhossain 

 

Attached is the sample file.  Thanks again for taking your time and looking into it.

 

https://www.icloud.com/iclouddrive/0TI9lHp56Cu64f9WIHUItrtMg#SampleYearQtr

@mehul26 

 

Thanks for the file, unfortunately from the dummy file I am not able to identify what you are trying to achieve, I would suggest please share the pbix with dummy data but with your required visuals and structure.

@mhossain 

 

If Previous Year is selected, the Year_Qtr_label should default to 'Previous Year Current Quarter.

 

If Current Year is selected, 'Current Quarter should be selected by default.

 

Note: The Quarter Data table should not have any impact on Current Year/Previous Year toggle. It should only toggle on Year_Qtr Label.

 

 

SampleData.jpg

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors