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.
Hi everyone, I am using the between date slicer and I would like to know if there is a possibility to set the first and second date to today by default every time we open the report. (Below my date table)
Solved! Go to Solution.
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.
The below tutorial will help in creating a slicer which will default to Today or Yesterday and also let you choose custom dates.
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.
This might work a look too if using the date picker is an option
https://www.youtube.com/watch?v=VaJ10ilXp6Y
Best,
PDG
@Anonymous , There no direct way. You can create some flag and restrict the values, That is successful in case of single date of flag as slicer itself
Example
Date Type = SWITCH(TRUE(),'Date'[Date] >= =TODAY() -20 && 'Date'[Date] <=TODAY(),"Last Dates"
,'Date'[Date]&"")
Date Type = SWITCH(TRUE(),'Date'[Date]=max(Table[Date]),"Lastest Date"
,'Date'[Date]&"")
@Anonymous
I do not think that is possible, however, you can search in the Ideas and vote for the same feature or create a new idea at https://ideas.powerbi.com/ideas/
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
96 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |