Forum Discussion
Custom setting for date slicer
- 2 years ago
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
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
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