The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi!
I have a report that uses a dates slicer (between) to filter the visuals.
My users wanted to open the report everyday and have the slicer set to a default time range with the max dat set to yesterday (cause every morning they're basically seeing the results from the last day)
When trying to achieve this I made a column in my Calendar Table called Day (Relative) that takes value '0' if it's TODAY(). I then filter my Date Slicer visual to have that Day (Relative) be less than 1.
My problem now comes when I want to see every day the default date in the slicer and at the same time see my card filtered for that default max date (yesterday).
This only works if I click on the slicer circle or manually pick the date again, otherwise, even tho the slicer itself updates cause my report dataset has a daily refresh, the card visual stays blank unlesss I click again on the date slicer.
I have attached a sample of my report with this situation.
All help welcomed, thank you!
I've struggled with this. SO MANY videos and "explanations" out there creating variables and custom lists for filter to sort on ... spent the past few hours attempting them - and NONE WORK. Super-basic functionality to add functionality to default values to solve all of these absurd workarounds (that don't work). As usual, Fabric is utterrly useless. I get much more useful content from other sites, and Microsoft never even bothers addressing the MOST BASIC of unresolved issues.
I have the same customer's requirement, any solution to prefiltered as default yesterday date and to have also the posibility also to select a range?
Thanks!
It seems like you're using Power BI or a similar data visualization tool to create your report. Your goal is to have a date slicer that defaults to a specific time range with the max date set to yesterday, and you want this default behavior to be applied automatically when users open the report.
The issue you're facing with the card visual not updating automatically when you load the report is likely due to the way the slicer interaction is set up. To achieve the desired behavior, you can follow these steps:
Create a Date Table: Ensure you have a Date table in your data model with a column that contains a continuous date range. This table should have a relationship with your main data table.
Set Default Values for Slicer: In Power BI, you can set default values for slicers by using the "Edit Interactions" feature. Here's how you can do it:
You can now define how other visuals on the report page interact with the slicer. For your case:
Create Measures for Default Values: Create DAX measures that calculate the default values you want for the slicer:
Set Default Values in Slicer: In the slicer, you can set these measures as the default values:
Now, when users open the report, the slicer will automatically default to the desired date range, and it should also filter the card visual accordingly without the need for users to interact with the slicer again.
Remember to ensure that your dataset's refresh schedule is set up to update the data daily so that the default end date (yesterday) is always accurate when users open the report in the morning.
Nope, not the answer. Yes, this is part of the solution but not an entire solution. Doing it this way, once a user selects a custom date with the date range slicer, the slicer will not return to the default date range even when clicking a "default date" button or some other workaround.
@123abc There is no way to set defult values for the date slicer when the style is "Between". You probably didn't understand the request of the user who raised the issue.
This is the answer!
Developers have asked for years for a default date option to be added to the between date range slicer. Microsoft continues to ignore this very fundamental request...likely because they're too focused on pushing Fabric instead of improving Power BI (the latest updates for the past 6 months or so have lagged).
Hi @123abc , regarding this suggestion below, can it be achieved on a date slicer with the Between style? Can't find how to do it.
Set Default Values in Slicer: In the slicer, you can set these measures as the default values:
Hello, any solutions on this? without limiting calendar to yesterday?
@Anonymous , As of now I doubt you can default the date range slicer.
We do a workaround for normal slicer to have column like
Date Type = SWITCH(TRUE(),'Date'[Date]=TODAY(),"Today",'Date'[Date]=TODAY()-1,"Yesterday",'Date'[Date]&"")
and save it for yesterday
Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA
hii, yes i have considered that solution but it works only if i use a slicer as a dropdown or list, because i'm mixing Text ("Yesterday" and "Today") with my date values. If i use the slicer style "Between" that will not work unfortunately.
meawnhile i have found a work around which was to limit my calendar to end in "yesterday", this way my card visual will not be blank.
problem is now if i have other pages in the report that, for example, have forecast and need the calendar to end in something like 31-12-2023