Forum Discussion
Default Slicer Selection and Trend chart help!!!
- 1 year ago
Hi cmkp2675
Sorry for the late response.
There isn’t a way to have a “between” slicer default itself to the latest date dynamically. Power BI doesn’t support that out-of-the-box without bookmarks. Instead, here’s a reliable pattern that meets both of your needs:
Please do follow the below steps that will resolve your issue:-
Swap your “Between” slicer for a Relative Date slicer set to “This 1 Days,” so it always defaults to today’s date
-
In Format → Edit interactions, disable the slicer’s filter on your table visual so it continues to show every date row
-
Create a measure that ignores any slicer and always sums the last 7 days, for example:
-------------------------------------------------------------------------------
LoadDurationLast7Days =
CALCULATE(
SUM('etl_pipeline_audit'[pipeline_run_duration_mins]),
DATESINPERIOD(
'Date_Table'[Date],
MAX('Date_Table'[Date]),
-6,
DAY
)
)
------------------------------------------------------------------------------- -
If needed, use Edit interactions to turn off slicer filtering on the trend chart so it consistently displays those seven days.
If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth. -
Hi cmkp2675
- Power BI’s native “between” date slicer does not support dynamic default selections out-of-the-box. However, a common workaround is to create a calculated column or measure in your Date table that flags the latest date, then use a relative date slicer or a custom slicer visual that supports default selections.
For example, you can create a measure like:
IsLatestDate = IF('Date'[Date] = MAX('Date'[Date]), 1, 0) - To show the past 7 days on your trend chart even when the slicer is set to a single date (like today), create a measure that ignores the slicer’s date filter and instead filters data for the last 7 days dynamically. Sample Measure:
Last7DaysMeasure =
CALCULATE(
SUM('YourTable'[Value]),
FILTER(
ALL('Date'),
'Date'[Date] >= MAX('Date'[Date]) - 6 && 'Date'[Date] <= MAX('Date'[Date])
)
)
If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.