Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.