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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Jyothishree
Helper II
Helper II

Date Slicers in two different page which does not sync but with dependency on MAX Date selected.

Hello,

I am looking for a solution for the requirement – I have two Pages “Year To Date” and “Week to Date” in Year to Date page there is a date slicer with ‘between’ and also in “Week to date” page again we have a date slicer with between. So actually here what I am looking for is, the default page is “Year To date” with a date range ‘28.08.23 to Today’
Here today is the Maximum date. There is a page navigation button from “Year To date” to “Week to Date” page. When a user navigates from ‘YTD’ to ‘WTD’ page, the date slicer in ‘WTD’ page must pick up the previous week range automatically, without locking other date(Here locking means user must still be able to pick up/select  other date ranges on WTD page)

For example –
a. On YTD page if the date range is 28.08.24 to10.08.24 and if user navigates to WTD page the selection in YTD page must still be (28.08.24 to10.08.24) but the date slicer in WTD page must pickup 29.07.24 to 04.08.24 so the the visuals will pick up the data according to the date range automatically.

b. Just to elaborate – If the user selects a date rage 01.01.24 to 31.03.24 in YTD page then the date slicer in WTD page must pickup the week range (18.03.24 to 24.03.24)


Also when the user switches back to YTD page the selection on YTD page must be same selected date range which was selected before navigating to WTD page. 
     
If the above requirement can be achieved with only one Date Table, then it is good but if it is not possible by using only one Date Table, I am fine with creating a custom data table as well. Any Help is appreciated. Thank you

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

Thanks for the reply from lbendlin , please allow me to provide another insight: 
Hi @Jyothishree ,

 

You can consider using the "Preselected slicer", but it does not change automatically, you need to manually click the reset button of the "Preselected slicer" to go back to the default state.

1. Create two date tables:

Table =
CALENDAR(
    DATE(2023,1,1),
    DATE(2024,12,31))
Table 2 =
CALENDAR(
    DATE(2023,1,1),
    DATE(2024,12,31))

2. We can get the three point in the "Visualizations", and we click the "Get more visual":

vyangliumsft_0-1723615847066.jpeg

3. Then we find the "Preselected Slicer" and add the visual to our Power Bi Desktop.

vyangliumsft_1-1723615847068.jpeg

4. we need to create a table with one column , and the value is True and False, like this:

vyangliumsft_2-1723615895668.png

5. Create measure[YTDPage_Table1_Slicer_Measure ] to be placed in YTDPage_Table1_Slicer-Table[Date] and click View - Sync slicers, to form the synchronized slicer of WTD_Page.

YTDPage_Table1_Slicer_Measure =
var _mindate=MINX(ALLSELECTED('Table 2'),'Table 2'[Date])
var _maxdate=MAXX(ALLSELECTED('Table 2'),'Table 2'[Date])
return
IF(
    MAX('Table'[Date])>=_mindate&&MAX('Table'[Date])<=_maxdate,TRUE(),FALSE())

6. Create measure[WTDPage_Table1_Slicer_Measure ] to be placed in WTDPage_Table1_Slicer-Table[Date] and click View - Sync slicers, to form the synchronized slicer of WTD_Page.

WTDPage_Table1_Slicer_Measure =
var _maxdate=MAXX(ALLSELECTED('Table'),'Table'[Date])
var _week=_maxdate-7
return
IF(
    MAX('Table 2'[Date]) >= _week&&MAX('Table 2'[Date])<=_maxdate,TRUE(),FALSE())

YTD_Page:

vyangliumsft_3-1723615913227.png

WTD-Page:

vyangliumsft_4-1723615913236.png

7. Scenario 1.

When YTDPage_Table1_Slicer of YTD_Page selects a date range of 2024.7.29 - 2024.8.10

vyangliumsft_5-1723615984714.png

WTDPage_Table2_Slicer of WTD_Page Clicking on the Reset button in the upper right corner will show the date range as:

vyangliumsft_6-1723615984716.png

8. Scenario 2.

When the user switches back to the YTD page, the YTD slicer displays the same date range as the WTD page, but also has to click on the reset button in the upper right corner to take effect.

 

vyangliumsft_7-1723616026904.png

9. Finally we are more in line with the requirements, we can cancel the display status of the respective slicer in the synchronized slicer on other pages respectively:

YTD_Page - YTDPage_Table1_Slicer -- cancel the eye icon on WTD_Page in the synchronized slicer

vyangliumsft_8-1723616055768.png

WTD_Page - WTDPage_Table2_Slicer -- Unsynchronize the eye icon in the slicer about YTD_Page

 

vyangliumsft_9-1723616055774.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
v-yangliu-msft
Community Support
Community Support

Thanks for the reply from lbendlin , please allow me to provide another insight: 
Hi @Jyothishree ,

 

You can consider using the "Preselected slicer", but it does not change automatically, you need to manually click the reset button of the "Preselected slicer" to go back to the default state.

1. Create two date tables:

Table =
CALENDAR(
    DATE(2023,1,1),
    DATE(2024,12,31))
Table 2 =
CALENDAR(
    DATE(2023,1,1),
    DATE(2024,12,31))

2. We can get the three point in the "Visualizations", and we click the "Get more visual":

vyangliumsft_0-1723615847066.jpeg

3. Then we find the "Preselected Slicer" and add the visual to our Power Bi Desktop.

vyangliumsft_1-1723615847068.jpeg

4. we need to create a table with one column , and the value is True and False, like this:

vyangliumsft_2-1723615895668.png

5. Create measure[YTDPage_Table1_Slicer_Measure ] to be placed in YTDPage_Table1_Slicer-Table[Date] and click View - Sync slicers, to form the synchronized slicer of WTD_Page.

YTDPage_Table1_Slicer_Measure =
var _mindate=MINX(ALLSELECTED('Table 2'),'Table 2'[Date])
var _maxdate=MAXX(ALLSELECTED('Table 2'),'Table 2'[Date])
return
IF(
    MAX('Table'[Date])>=_mindate&&MAX('Table'[Date])<=_maxdate,TRUE(),FALSE())

6. Create measure[WTDPage_Table1_Slicer_Measure ] to be placed in WTDPage_Table1_Slicer-Table[Date] and click View - Sync slicers, to form the synchronized slicer of WTD_Page.

WTDPage_Table1_Slicer_Measure =
var _maxdate=MAXX(ALLSELECTED('Table'),'Table'[Date])
var _week=_maxdate-7
return
IF(
    MAX('Table 2'[Date]) >= _week&&MAX('Table 2'[Date])<=_maxdate,TRUE(),FALSE())

YTD_Page:

vyangliumsft_3-1723615913227.png

WTD-Page:

vyangliumsft_4-1723615913236.png

7. Scenario 1.

When YTDPage_Table1_Slicer of YTD_Page selects a date range of 2024.7.29 - 2024.8.10

vyangliumsft_5-1723615984714.png

WTDPage_Table2_Slicer of WTD_Page Clicking on the Reset button in the upper right corner will show the date range as:

vyangliumsft_6-1723615984716.png

8. Scenario 2.

When the user switches back to the YTD page, the YTD slicer displays the same date range as the WTD page, but also has to click on the reset button in the upper right corner to take effect.

 

vyangliumsft_7-1723616026904.png

9. Finally we are more in line with the requirements, we can cancel the display status of the respective slicer in the synchronized slicer on other pages respectively:

YTD_Page - YTDPage_Table1_Slicer -- cancel the eye icon on WTD_Page in the synchronized slicer

vyangliumsft_8-1723616055768.png

WTD_Page - WTDPage_Table2_Slicer -- Unsynchronize the eye icon in the slicer about YTD_Page

 

vyangliumsft_9-1723616055774.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

lbendlin
Super User
Super User

Ditch the slicers and use the Filter Pane.  There you can specify report level filters.

@lbendlin Thank you for your reply. We need Date Slicers on both page as per requirement and yes I can understand there is a need to use filter pane to apply a measure on the date slicer in WTD page. I am looking for a measure as per the requirement mentioned in the question.

push back on the requirement. Show your users alternatives.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors