The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi, I have a date slicer from dim_date table which is connected to the fact_tables. Now, I want the date filter to show todays date, even if there is no data available
Thanks for the reply from Kedar_Pande and 123abc , please allow me to provide some additional insights.
Hi @Zulaikha ,
You could create a new date table based on the minimum date in your 'dim_table'.
Date =
ADDCOLUMNS(
CALENDAR(
MIN('Table'[Date]),
TODAY()
),
"Year", YEAR([Date]),
"Month", MONTH([Date]),
"Day", DAY([Date])
)
It will refresh to the current date and we could use ‘Between’ in the date slicer setting
Don't forget to create a new relationship with the fact_tables.
Could you please provide example data or sample files here if you have any confused? We could offer you more help if we have information in detail. There is sensitive data that can be removed in advance. How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Thanks for your understanding. Your time and cooperation are much valued by us. We are looking forward to hearing from you to assist further.
Best regards,
Lucy Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Use a measure to set today’s date as the default filter in the slicer.
DefaultDate =
IF(
MAX('dim_date'[Date]) = TODAY(),
1,
0
)
Add the DefaultDate measure.
Set the filter to show only rows where DefaultDate = 1.
This ensures the slicer highlights today’s date by default but still allows the user to select other dates if needed.
💌 If this helped, a Kudos 👍 or Solution mark ✅ would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
You can achieve this in Power BI by using a combination of DAX and setting the default value for your date slicer. Here’s a step-by-step guide:
Create a New Measure:
TodayDate = TODAY()
Add a Calculated Column:
IsToday = IF('dim_date'[Date] = TODAY(), 1, 0)
Set Default Value in Slicer:
Adjust Slicer Settings:
By following these steps, your date slicer should default to today’s date, even if there’s no data available for that date. Let me know if you need any more help!
I want the slicer setting to be " Between "