Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Experts,
I’m working on a Power BI report using a SQL view called REPORT_V, and I’ve created a custom Date table and a DatePeriods table to control the date filtering logic.
Date Table:
Date =
DatePeriods Table:
DatePeriods = UNION( ADDCOLUMNS( FILTER(CALENDAR(MIN('Date'[Date]), MAX('Date'[Date])), [Date] = TODAY()), "Type", "Today", "Sort", 1 ), ADDCOLUMNS( FILTER(CALENDAR(MIN('Date'[Date]), MAX('Date'[Date])), [Date] = TODAY() - 1), "Type", "Yesterday", "Sort", 2 ) )
I want the date logic to default to "Today" even if there's no data available for Today in the source table.
I only want two options in my slicer: Today and Yesterday — no Custom option.
The visuals should update based on the selected value (Today or Yesterday).
is there a better way to make sure “Today” is always selected by default, even when there's no data for Today in the source table?
Any best practices or suggestions are appreciated!
Thank you in advance!
Solved! Go to Solution.
Your calendar max date is from EOD report, which may not have any rows for yesteday
Date =
CALENDAR(
MIN('EOD_REPORT_V'[DATE]),
MAX('EOD_REPORT_V'[DATE])
)
This will always include today in Calendar
Date =
CALENDAR(
MIN('EOD_REPORT_V'[DATE]),
TODAY()
)
Hi @manoj_0911 ,
Thanks for reaching out. Along with @Tutu_in_YYC & @speedramps responses, I’ve tested the scenario with dummy data where we dynamically calculate sales for Today or Yesterday using a disconnected slicer with values like Today and Yesterday.
I followed these steps
DAX:
Sales_At_Selected_Date =
CALCULATE(
SUM(SalesData[Sales]),
FILTER(
SalesData,
SalesData[Date] = [SelectedPeriodDate]
)
)
The measure updates correctly based on the slicer selection and reflects accurate totals for today or yesterday sales dynamically.
I’ve attached a sample .pbix file here for your reference so you can review the setup and reuse it as needed.
— Yugandhar
Community Support Team.
Your calendar max date is from EOD report, which may not have any rows for yesteday
Date =
CALENDAR(
MIN('EOD_REPORT_V'[DATE]),
MAX('EOD_REPORT_V'[DATE])
)
This will always include today in Calendar
Date =
CALENDAR(
MIN('EOD_REPORT_V'[DATE]),
TODAY()
)
I would then add a custom column, that will detect today's date and label it as "Today". Note that, it is a Text format column.
In your slicer, select "Today", and use it as default. This way, everytime they open up the report, it will default to "Today" selection, and not stuck to a fixed date. However, make sure the semantic model refresh everyday, so "Today" is always updated to today's date. Also note, it is a Text format column.
Another option would be to use the filter
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
68 | |
64 | |
52 | |
39 | |
26 |
User | Count |
---|---|
80 | |
57 | |
45 | |
44 | |
35 |