Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Dear community,
I know there are several threads regarding the question of adding default values to a slicer but so far I did not find a solution to my problem.
I am having a report with several visuals which interact with the standard Power BI date slicer:
I am trying to setup a default value for the "time frame selection" which always shows the previous 7 days when I open the report.
Example for today (30.07.2021): From 23.07.2021 until 29.07.2021
My problem is that I am looking for a solution which enables our users to also make an individual adjustement of the time frame by using the slicer. Maybe someone can help me out on that point.
Best regards and thanks in advance!
Carsten
Solved! Go to Solution.
@Raptor
I recently made a video to solve the common default date filter problems, please refer to this video:
https://youtu.be/KBEsPGxDxHM
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Just a quick update from my side since I tried all the solutions mentioned above. Unfortunately, they did not lead me to the success which is required by our company.
Therefor I created an own approach:
- Setup of three individual buttons which are linked to several pages including different pre-specified relative periods:
- Setup of anothrer individual button that triggers one sub-page including a slicer:
I know it is not the most clean solution but it actually works quite well.
@Raptor
I recently made a video to solve the common default date filter problems, please refer to this video:
https://youtu.be/KBEsPGxDxHM
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi @Raptor ,
Currently, there is no such function to set a default value for the slicer. But you can achieve this goal through the following methods.
1.Create a seperate table by entering data.
Here I use the exclamation mark to make him the first place in the slicer. The slicer is set to single selection.
2. Then the measure can be created like
Measure = IF(SELECTEDVALUE('Table (3)'[default value])="!previous 7 days",CALCULATE(SUM('Main table'[Value]),FILTER('Calendar',[Date]<=TODAY()&&[Date]>=TODAY()-6)),SUM('Main table'[Value]))
In this way, every time you open the report, the default is the data of the previous seven days. If you want to filter, select all from the single-choice slicer and filter the date range.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Raptor , As of now we can not initialize both days.
The workaround is you can clear a new column in the date table
Switch( true() ,
[date] >= today() && [date] >= today() -7 , "Last 7 days",
"others"
)
Or you can use a relative date slicer
Or approach like this https://community.powerbi.com/t5/Desktop/Required-custom-date-Slicer-Last-7-days-last-15-days-last-3...
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
123 | |
79 | |
49 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |