Forum Discussion
Custom setting for date slicer
Hi,
I am building a dashboard which contains data from last 30 days to next 30 days based on "Arrival Date" field.
I am looking to create a date slicer with slider which defaults between oldest date (-30 days) to current date, while dashboard is launched. The user can then choose to change the dates based on his/her need.
Could you please assist?
Thanks in advance!
Muralidhar
murali5431 , Ok, I have tried it you can check Power BI file attached currently we cannot select default date in Power BI but I have used bookmark for this
4 Replies
- bhanu_gautamSuper User
murali5431 , Ok, I have tried it you can check Power BI file attached currently we cannot select default date in Power BI but I have used bookmark for this
- murali5431Helper III
Thank you.. bhanu_gautam .. I will review the file and confirm.
- bhanu_gautamSuper User
murali5431 , You can create a dynamic date table which show +30 and -30 days by going to modelling tab and create a new table
DateRange =
VAR StartDate = TODAY() - 30
VAR EndDate = TODAY() + 30
RETURN
CALENDAR(StartDate, EndDate)After that you can create one new measure from this table for default date range
DefaultDateRange =
VAR MinDate = TODAY() - 30
VAR MaxDate = TODAY()
RETURN
IF(
SELECTEDVALUE('DateRange'[Date]) >= MinDate && SELECTEDVALUE('DateRange'[Date]) <= MaxDate,
1,
0
)And add this measure in visual of the slicer and set the filter to show items where Default date range=1 and create a slider and between slicer
- murali5431Helper III
bhanu_gautam Thanks a lot for your quick response!
What I obtained currently is below, where current date at the end of the slider
My objective is to obtain a slicer as below on launch, after which the user can drag the slider till end (+30 days), as needed.
Hope this explains my requirement.
Thanks,
Muralidhar