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
Since your X-axis is Date and Y-axis is Load Duration (Min), and you want the chart to always show the last 7 days regardless of slicer selection, you need to:
-
Make sure the Date slicer is a relative date slicer set to “in the last 7 days.” This makes the slicer dynamically update with the latest dates.
-
If you must keep a regular slicer, then create a measure that ignores the slicer filter on Date and forces the last 7 days data. For example:
LoadDurationLast7Days =
CALCULATE(
SUM('Table'[Load Duration]),
FILTER(
ALL('Date'[Date]),
'Date'[Date] >= TODAY() - 7 && 'Date'[Date] <= TODAY()
)
) -
Use this measure on the Y-axis instead of the original measure.
-
On the visual’s X-axis, use the Date column but make sure to turn off any slicer or page level filter on the Date column, or if you want to keep slicer for other visuals, use the measure that ignores the slicer filter as shown.
If this still doesn’t work, please share the exact DAX measure and slicer setup you are using so I can help debug further.
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.
- cmkp26751 year agoFrequent Visitor
Hi v-csrikanth
Thank you for your response.
But still not working no filters applied except Dropdown SLICER (it's mandatory) to filter other visuals.
DAX:
LoadDurationLast7Days =CALCULATE(SUM('etl_pipeline_audit'[pipeline_run_duration_mins]),FILTER(ALL('Date_Table'[Date]),'Date_Table'[Date] >= TODAY() - 7 && 'Date_Table'[Date] <= TODAY()))