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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Sri95
Frequent Visitor

Selection of value in slicer affects how my DAX works.Want some selected values in slicer to remain

Sri95_0-1735834756366.png

Sri95_1-1735834779308.png

All my KPIs should depend on the 3 date columns that are available. My cards and visuals are using similar measures. Depending on the date selection in the 'Date Type Basis' slicer, my value should change, my DAX is also written according to that (as seen in the screenshots). I want the date range slicer to change depending on the date selection as well. So, I created 3 bookmarks for the 3 dates, put shapes over the dates, made respective date selections and put the respective date column in the date range slicer. The selection of 'Date Type Basis' is important for all my DAX calculations. There are other slicers below the date range slicer as well which are common for all dates. 
If I make some selections in the slicers below, and want them to remain even if I change the selection in 'Date Type Basis' table, what should I do?

If I uncheck Data for each bookmark, the other slicers values are remaining when I change the Date Type Basis slicer, but when I click the bookmark which is on the date is not changing and hence the values in KPI cards and visuals are also not changing as the DAX depends on the 'Date Type Basis' selection.

Is there a way to let the selection in the other slicers to remain when a bookmark is changed but, the Date Type basis selection changes as per the selected date.

Or is there a way where I can dynamically change the value of the date in slicer based on the 'Date Type Basis' slicer? 

 

1 ACCEPTED SOLUTION
v-mengmli-msft
Community Support
Community Support

Hi @Sri95 ,

 

The bookmark saves the state of the visual when the bookmark was created, and when the user selects a bookmark, the visual returns to its default state.

 

You can create a relationship between the DateTypeBasis and three date columns, for example, in the calendar table, create a calculated column, and return "Date1" if the date is in the Date column in the RegdDate table. If the date is in the Date2 column, then "Date2" is returned.

DateTypBasis = SWITCH(TRUE(),'Calendar'[Date] IN ALL(RegdData[Date]),"Date1",'Calendar'[Date] IN ALL(RegdData[Date2]),"Date2","Date3")

vmengmlimsft_0-1735883520567.png

Then put the Date column and DateTypeBasis column of the calendar table into the slicer.

vmengmlimsft_1-1735883968626.png

When a user selects DateTypeBasis, the date range will be automatically filtered. When the user changes date range, the date range is saved even if the date category is changed.

 

 

 

———————————————————————————————————————————————————

If my answer solves the problem, please accept it as a solution. This will let it be seen by more people in need.

 

 

Best regards,

Mengmeng Li

 

 

View solution in original post

4 REPLIES 4
v-mengmli-msft
Community Support
Community Support

Hi @Sri95 ,

 

The bookmark saves the state of the visual when the bookmark was created, and when the user selects a bookmark, the visual returns to its default state.

 

You can create a relationship between the DateTypeBasis and three date columns, for example, in the calendar table, create a calculated column, and return "Date1" if the date is in the Date column in the RegdDate table. If the date is in the Date2 column, then "Date2" is returned.

DateTypBasis = SWITCH(TRUE(),'Calendar'[Date] IN ALL(RegdData[Date]),"Date1",'Calendar'[Date] IN ALL(RegdData[Date2]),"Date2","Date3")

vmengmlimsft_0-1735883520567.png

Then put the Date column and DateTypeBasis column of the calendar table into the slicer.

vmengmlimsft_1-1735883968626.png

When a user selects DateTypeBasis, the date range will be automatically filtered. When the user changes date range, the date range is saved even if the date category is changed.

 

 

 

———————————————————————————————————————————————————

If my answer solves the problem, please accept it as a solution. This will let it be seen by more people in need.

 

 

Best regards,

Mengmeng Li

 

 

lbendlin
Super User
Super User

 I want the date range slicer to change depending on the date selection as well.

That will not work if you had default values for that range slicer, or if the user interacted with the slicer. Selected values will continue to be visible even if they are no longer part of the new range.

Okay, thank you! What do you think of the bookmarks? 
This - Is there a way to let the selection in the other slicers to remain when a bookmark is changed but, the Date Type basis selection changes as per the selected date.

Bookmarks need to exclude the data otherwise they make the problem worse 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors