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
AlvaradoLarry
Regular Visitor

Date Slicer Defualt to yesterady using Date dimension

Hi Experts!

 

I have a problem setting the date filter to defualt to yesterday. I have an "As of Date" measure that calculates between a start date and end date. Where the start date is less than or equal to the "As of Date" and the end date is greater or equal to the "As of Date"

 

I am using a single date dimension to accomplish this and want to have the defualt date in the slicer shown below to yesterdays date

 

Date Slicer.png

I would like to try to keep this in  a single slicer if at all possible!

 

Thanks in advance for the help!

 

1 ACCEPTED SOLUTION

@AlvaradoLarry 

 

You may refer to the post below.

https://community.powerbi.com/t5/Desktop/i-have-two-dates-using-measures-and-want-to-set-these-dates...

 

Community Support Team _ Sam Zha
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

5 REPLIES 5
andres777
Advocate III
Advocate III

I needed to combine 3 functionalities not found in Date Pickers:

  • Default to Yesterdy's date, no matter when the report is open
  • Allow the user an easy  graphical interface to select other dates for this month, or any other Month or Year in the past.
  • Be able to synchronize ALL Reports Tabs to the selected date in the calendar.

We had many users pushing us (BI Analyts) to come up with a more professional solution that works well and looks good.

 

So I had to write my own custom Visual DatePicker (and go through the steep learning curve to learn all: Node Js, Ms Code, JavaScript, XML Parameters, Syncfusion parameters, Power BI compilation process, Sync calendars, etc) it took me around 2 months or more to come up with something end users would love and accept to use.

 

Since I didn't want to reinvent the wheel, I searched and searched all over to find some source code I could re-use inside Power BI environment. Because Power BI acts and works like a website,  I thought I should look for javascript components.  So I found and purchased the SyncFusion Essential JS 2 libraries, just to use one control, the datePicker, the other 59 controls are available for us to use at another time if we want...

A sample of how their calendar datepicker works in on their demo page... Link

Disclaimer : I don't work for SyncFusion or get paid by them to say these comments, I'm just a frustrated user that wanted a professional solution inside Power BI, which according to most users, should be out by now.

 

Clicking on a Day will select that date, clicking on "May 2020" will allow you to select the Month, and further down, clicking on the "2020" will allow you to select the Year. Very simple, elegant and professional.

 

picking a day ;

image.png

picking a Month

image.png

picking a Year :

pick a yearpick a year

 

This is what mine looks inside Power BI... 

 

It Defaults to Yesterday's date, no matter when you open the report.

 

Users click on the Calendar Icon, and I bring the bookmark Page that contains the 

DatePicker Control.  Allowing them to select ONE, single date.

(I removed some labels from the grid, to protect the inocent :)...)

image.png

image.png

Hope this helps some people...

 

Andres

baghdadi62
Resolver III
Resolver III

Hi, follow steps:

Step1: select the type of slicerStep1: select the type of slicer

Step2: change slicer type to relative dateStep2: change slicer type to relative date

step3: select last 1 Daysstep3: select last 1 Days

 

With that solution i wouldn't be able to give the business a way to look at a specific "date as of"... I would still need to have a date selected where the user can change it.

@AlvaradoLarry 

 

You may refer to the post below.

https://community.powerbi.com/t5/Desktop/i-have-two-dates-using-measures-and-want-to-set-these-dates...

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
JosefPrakljacic
Solution Sage
Solution Sage

Hey @AlvaradoLarry ,

 

how about using the Filter Pange to Filter your Slicer? You could use a relative date filter.

The downturn would be that you don't have the current  day available.

 

Please don't forget to give a 👍 and accept the post as solution. (If it helped 😅)
Have a nice day!

BR,
Josef
Graz - Austria 

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.