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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
just3235
Helper I
Helper I

Set TODAY as default date in slicer visual (date range)

Hello,

I want my date range (slicer) to dynamically set the date range from the first date value in the dataset to the current date (i.e. today's date).  We have some target values for future dates, however, I want the slicer to set the date range limit to current date  and dynamically change the current date as we move on to the next date. 

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @just3235,

 

Currently, it is not supported to set default values for slicer. Here is an idea, you could click to vote it up. 

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

15 REPLIES 15
ELW
Advocate II
Advocate II

Happy fifth birthday to this question.  It looks like there is still no real solution to wanting a date range slicer to default to the latest date in the data when refreshed?  

Baffling right?

You can check following article to create a slicer with custom defaults: (99+) Custom Range Date Slicer in Power BI with dynamic defaults and more... | LinkedIn

nanojau
Frequent Visitor

Hello community,

 

I working in the Power BI Report and I would like to Set as Default Date in Slicer. Follow below example:

 
 
 

 

I want to bring Filters on this visual with(Today() – 90 days) when I open the report in this range and start with default. The Date Slicer cannot be locked(affected by the Filters on this visual) in the same range (Today() – 90 days), but yes showing all date range and inactive the Filters on visual page like the picture above:

pb2.PNG

 
 
 
 

 

Regards,

Adriano F Pereira

v-yulgu-msft
Employee
Employee

Hi @just3235,

 

Currently, it is not supported to set default values for slicer. Here is an idea, you could click to vote it up. 

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Yuliana!

Hi @just3235@v-yulgu-msft

 

In case if you are embedding the report, It is possible to set default values for slicer through Power BI Javascript API.

Here is the link:
https://github.com/Microsoft/PowerBI-JavaScript/wiki/Slicers

 

Also, you can see working demos of these APIs through Power BI Embedded Playground.
https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html

 

 

Regards,

Prateek Raina

Hi Prateek,

 

Unfortunately I am not. But thank you for those links!

Thanks Prateek!

LivioLanzo
Solution Sage
Solution Sage

@just3235

 

it's possible but you 're going to need to share an example of your data

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Hi LivioLanzo,

What exactly would you need? 

Thanks!

An example of your tables and how they are related

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Hi LivioLanzo,

I am pulling up data in Power BI for this table (let's call it Inventory Table) from our DW using a stored procedure. The Inventory Table has the Actuals Value (current value) & Target Value (targets that we need to meet) & a date column. 

The date column is updated in the DW everytime an Actual or Target value is set.

 

The Actuals column has values upto the current date (today's date) and is 0 for future dates. While the Targets value has values for the future dates as well.  That is why my slicer range ends at the last value of my Target value (as shown in the image above, 12/1/2018).

I just need to create a visual for Actuals vs Target & provide a date slicer (range) where the end value of the slicer is the current date (today's date).

I hope this helps! 

just3235
Helper I
Helper I

slicer1.PNGslice2.PNG

The first image is what I have as default. The second image is what I want by default.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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