Forum Discussion
Set default date to today on date slicer
- Anonymous5 years ago
Hi Anonymous
In addtion to Fowmy and amitchandak's reply. We can't let the slicer select Date = Today by default, but we can build a measure to show you Today's value in Table as Default.
I build a Table with Date column. And then build a Slicer Table (Calendar Table)
Slicer = CALENDAR(DATE(2020,10,01),DATE(2020,10,10))Then Build a Date Measure and build a Table visual by this Date Measure and other columns.
M.Date = VAR _MAX = MAX ( Slicer[Date] ) VAR _MIN = MIN ( Slicer[Date] ) VAR _Select = CALCULATE ( MAX ( 'Table'[Date] ), FILTER ( 'Table', 'Table'[Date] <= _MAX && 'Table'[Date] >= _MIN ) ) VAR _Default = CALCULATE ( MAX ( 'Table'[Date] ), FILTER ( 'Table', 'Table'[Date] = TODAY () ) ) RETURN IF ( ISFILTERED ( Slicer[Date] ), _Select, _Default )The Table visual will show you Today's value if you don't select slicer.
You can download the pbix file from this link: Set default date to today on date slicer
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
In addtion to Fowmy and amitchandak's reply. We can't let the slicer select Date = Today by default, but we can build a measure to show you Today's value in Table as Default.
I build a Table with Date column. And then build a Slicer Table (Calendar Table)
Slicer = CALENDAR(DATE(2020,10,01),DATE(2020,10,10))
Then Build a Date Measure and build a Table visual by this Date Measure and other columns.
M.Date =
VAR _MAX =
MAX ( Slicer[Date] )
VAR _MIN =
MIN ( Slicer[Date] )
VAR _Select =
CALCULATE (
MAX ( 'Table'[Date] ),
FILTER ( 'Table', 'Table'[Date] <= _MAX && 'Table'[Date] >= _MIN )
)
VAR _Default =
CALCULATE (
MAX ( 'Table'[Date] ),
FILTER ( 'Table', 'Table'[Date] = TODAY () )
)
RETURN
IF ( ISFILTERED ( Slicer[Date] ), _Select, _Default )
The Table visual will show you Today's value if you don't select slicer.
You can download the pbix file from this link: Set default date to today on date slicer
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous !
Can you please share the pbix file?
I could not figure it out..