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

Don'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.

Reply
Raptor
Helper I
Helper I

Date Slicer: Default values

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:

 

Raptor_0-1627633422331.png

 

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

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Raptor 

I recently made a video to solve the common default date filter problems, please refer to this video: 

https://youtu.be/KBEsPGxDxHM


 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
Raptor
Helper I
Helper I

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:

 

Raptor_0-1629355631525.png

 

- Setup of anothrer individual button that triggers one sub-page including a slicer:

 

Raptor_1-1629355676513.png

 

I know it is not the most clean solution but it actually works quite well.

Fowmy
Super User
Super User

@Raptor 

I recently made a video to solve the common default date filter problems, please refer to this video: 

https://youtu.be/KBEsPGxDxHM


 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

v-stephen-msft
Community Support
Community Support

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. 

Untitled picture.png

Here I use the exclamation mark to make him the first place in the slicer. The slicer is set to single selection.

9.png

 

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.

10.png

 

 

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.

 

amitchandak
Super User
Super User

@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...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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