Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
manoj_0911
Post Patron
Post Patron

How to Default Date Slicer to “Today” Even If There Is No Data?

 

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.


🔧 My Logic So Far:

Date Table:

 

Date =

CALENDAR(
    MIN('EOD_REPORT_V'[DATE]),
    MAX('EOD_REPORT_V'[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
    )
)

🎯 What I Want:

  • 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).


My Problem:

  • 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!

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

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()
)
 

 

 

View solution in original post

3 REPLIES 3
V-yubandi-msft
Community Support
Community Support

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

  1. Created a disconnected table with valuesToday and Yesterday.
  2. Used the below DAX measure to calculate sales based on the selected period

DAX:

Sales_At_Selected_Date = 
CALCULATE(
    SUM(SalesData[Sales]),
    FILTER(
        SalesData,
        SalesData[Date] = [SelectedPeriodDate]
    )
)

 

Vyubandimsft_1-1750239547385.png

 

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.

speedramps
Super User
Super User

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.

Tutu_in_YYC_0-1750184731439.png

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

Tutu_in_YYC_1-1750184838690.png

 



 

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.