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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
a_dika
New Member

set the date slicer so it always updates to today's date

a_dika_0-1721098834604.png

Hi,

 

on the Power BI dashboard, I have created a date table that includes dates starting from 1/1/2000 - 12/31/2050.

Here is the DAX that I have created:
DateTable =
VAR StartDate = DATE(2000, 1, 1) // Adjust the start date as needed
VAR EndDate = DATE(2050, 12, 31) // Adjust the end date as needed
RETURN
ADDCOLUMNS(
CALENDAR(StartDate, EndDate),
"DateAsInteger", FORMAT( [Date], "YYYYMMDD" ),
"Year", YEAR( [Date] ),
"MonthNumber", MONTH( [Date] ),
"MonthName", FORMAT ( [Date], "MMMM" ),
"Day", DAY ( [Date] ),
"CheckTodaysDate", IF([Date] = TODAY(), 1, 0) // New column to identify if the date is after today
)

I put "Date" into the slicer and selected the after option so that the date displayed is 1/1/2000. I filtered the "Date Slicer" using "CheckTodaysDate" and it will filter to the current date. But I can't select a date other than today's date.

 

Is there any way to make the date in the "Date Slicer" display today's date, but it will filter data from the first date to today's date and I can still select dates other than today's date?

1 ACCEPTED SOLUTION
cath1ynn
Resolver II
Resolver II

Pretty easy actually. You just change your "CheckTodaysDate" to the below and you should be able to select dates other than today and the To in the Date filter should always show today.

 

IF([Date] <= TODAY(), 1, 0)

 Before applying filter:

cath1ynn_0-1721105855744.png

After applying filter:

cath1ynn_1-1721105866792.png

 

View solution in original post

3 REPLIES 3
Idrissshatila
Super User
Super User

Hello 

 

Leaving this here as it may help people searching
https://youtu.be/kVcStgZhnuw?si=__o61_izYQkikbn8

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




cath1ynn
Resolver II
Resolver II

Pretty easy actually. You just change your "CheckTodaysDate" to the below and you should be able to select dates other than today and the To in the Date filter should always show today.

 

IF([Date] <= TODAY(), 1, 0)

 Before applying filter:

cath1ynn_0-1721105855744.png

After applying filter:

cath1ynn_1-1721105866792.png

 

Ritaf1983
Super User
Super User

Hi @a_dika 

Please refer to my solution in the linked discussion:
https://community.fabric.microsoft.com/t5/Desktop/PowerBI-Date-slicer-not-extending-to-the-latest-da...

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.