Dynamic Date Selection in Power BI

I got frequent ask from Biz users to keep the default date range in Power BI Dashboards e.g., last 3,6 months and it should dynamically change based on the current date. We can achieve this requirement with a relative slicer, but there is a limitation to select a custom date range.

It is not the end of the world????. This blog has a workaround to achieve such use cases in the following simple steps.

The below report used to demonstrate the workaround,

Default Date Selection in Power BI

Let’s assume that we wanted to default the date slicer selection to the Last 3 completed months.

Step 1: Create a relative Slicer in addition to the Date Between slicer.

Default Date Selection in Power BI

Step 2: Apply the required filter. In this case, the Last 3 completed months

Default Date Selection in Power BI

Step 3: Hide the relative slicer and create a button/icon

Go to, Power BI Desktop ribbon -> View -> Selection

Default Date Selection in Power BI

  • Hide the slicer
  • Create a button and align it on top of the existing slicer(UI: I enabled Background and set transparency 50%)

Default Date Selection in Power BI

Step 4: Create bookmarks

Go to, Power BI Desktop ribbon -> View -> Bookmark

Default Date Selection in Power BI

  • Select Relative Slicer, Button, and Date slicer in the selection pane
  • Create a bookmark with Selected Visual – Default Selection

Default Date Selection in Power BI

  • Hide button
  • Clear relative slicer filter and hide it

Default Date Selection in Power BI

  • Create another bookmark – Clear Default Selection

Default Date Selection in Power BI

Step 5: Create an icon or a button to configure the bookmarks

I used the button created earlier to configure Clear Default Selection.

Default Date Selection in Power BI

Publish and check the Power BI Report,

Default Date Selection in Power BI

Power BI has a lot of Power full features. At times, we need to combine multiple features to create what we need. With the above steps, Dynamic Default Date Selection is possible with one or two additional clicks. The same workaround can be used for the Last N Days/Weeks/Years.  Please feel free to reach Cittabase for more information. Visit our blogs for more topics on Power BI.