Forum Discussion
Zulaikha
1 year agoFrequent Visitor
Date slicer
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
123abc
1 year agoCommunity Champion
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:
- Go to your dim_date table and create a new measure to get today’s date.
TodayDate = TODAY()
Add a Calculated Column:
- Add a calculated column in your dim_date table to check if the date is today.
IsToday = IF('dim_date'[Date] = TODAY(), 1, 0)Set Default Value in Slicer:
- Add the IsToday column to your slicer as a filter and set it to 1. This will ensure that today’s date is selected by default.
Adjust Slicer Settings:
- Go to the slicer settings and ensure that it allows for single selection. This way, even if there’s no data for today, the slicer will still show today’s date.
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!
Zulaikha
1 year agoFrequent Visitor
I want the slicer setting to be " Between "