Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe 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.
Hello,
we all know the bookmarks function can become tricky very often.
I have a report where one bookmark is set the page filter filter "todays" numbers.
In case the user want to see the history data I have another button where it make one date slicer appear and reset the "todays panel filter to last 3 month.
"Data" in both bookmarks is selected.
In the slicer options I forced the "only select one" option.
What I want is that if the user clicking on "History", that the slicer always selected the newest date by default.
But unfortunately it will only select the date which the bookmark is last updated with.
Is there a workaround for this?
Best.
Solved! Go to Solution.
This is a classic mistake we all make when we first start with Power BI!
We create a report on 21/11/2021 with a dropdown set to 21/11/2021 and expect it to move the next day. It won’t!
The workaround is to create a pick list with "Current day", “Current week", “Previous week" etc then save those as book marks.
Then in your Power Query refresh the pick list with the up-to-date values.
Then use relationships to convert "Current day or “Current week" to dd/mm/yyyy keys on your fact tables.
There are some videos on Youtube how to do this.
Step-by-step instructions:-
In Power Query create a Calendar table and exact copy Hidden calendar.
Then in Power BI click New Table and ceate a Period Pick List with Dax (see below example).
Then create a Period Pick List (1:M) Calendar relationship with Cross Filetr direction = both
Then create a Calendar (1:M) Fact tables Filter direction = single
Then add the Period Pick List value to a dropdown or filter box.
Save your book marks with the dropdown or filter box set to "Current day".
ADDCOLUMNS(
CALCULATETABLE(
VALUES('Hidden calendar'[Date])
),
"Period", "All dates"
)
,ADDCOLUMNS(
CALCULATETABLE(
VALUES('Hidden calendar'[Date]),
'Hidden calendar'[DayOffset]=0
),
"Period", "Current day"
)
,ADDCOLUMNS(
CALCULATETABLE(
VALUES('Hidden calendar'[Date]),
'Hidden calendar'[WeekOffset]=0
),
"Period", "All current week"
)
,ADDCOLUMNS(
CALCULATETABLE(
VALUES('Hidden calendar'[Date]),
'Hidden calendar'[WeekOffset]=-1
),
"Period", "Previous week"
)
etc, etc, etc
If you want the options to display is nice equence then consider adding a sort key to the Period Slicer
This is a classic mistake we all make when we first start with Power BI!
We create a report on 21/11/2021 with a dropdown set to 21/11/2021 and expect it to move the next day. It won’t!
The workaround is to create a pick list with "Current day", “Current week", “Previous week" etc then save those as book marks.
Then in your Power Query refresh the pick list with the up-to-date values.
Then use relationships to convert "Current day or “Current week" to dd/mm/yyyy keys on your fact tables.
There are some videos on Youtube how to do this.
Step-by-step instructions:-
In Power Query create a Calendar table and exact copy Hidden calendar.
Then in Power BI click New Table and ceate a Period Pick List with Dax (see below example).
Then create a Period Pick List (1:M) Calendar relationship with Cross Filetr direction = both
Then create a Calendar (1:M) Fact tables Filter direction = single
Then add the Period Pick List value to a dropdown or filter box.
Save your book marks with the dropdown or filter box set to "Current day".
ADDCOLUMNS(
CALCULATETABLE(
VALUES('Hidden calendar'[Date])
),
"Period", "All dates"
)
,ADDCOLUMNS(
CALCULATETABLE(
VALUES('Hidden calendar'[Date]),
'Hidden calendar'[DayOffset]=0
),
"Period", "Current day"
)
,ADDCOLUMNS(
CALCULATETABLE(
VALUES('Hidden calendar'[Date]),
'Hidden calendar'[WeekOffset]=0
),
"Period", "All current week"
)
,ADDCOLUMNS(
CALCULATETABLE(
VALUES('Hidden calendar'[Date]),
'Hidden calendar'[WeekOffset]=-1
),
"Period", "Previous week"
)
etc, etc, etc
If you want the options to display is nice equence then consider adding a sort key to the Period Slicer
Hi @speedramps ,
nice ! You put it into "ready" selectable categories.
In the meantime I found something very simple fix point where my report can switch to by default.
Of course a mastercalendar is needed, then I make an additional calculated column in that calendar like:
Today Column = if ( Mastercalendar [Date] = Today(), then "Today", Mastercalendar[Date])
That is my new dimension column for that slicer. The good thing is...I can select "Today" as my new preselected Date. And it will always start on that if I had save the report so.
Thank you very much, of the ideas to make other categories. They come up much more handy if I need preselected timeframes without the need to click so many filters.
Best regards.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
83 | |
69 | |
68 | |
39 | |
37 |