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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Create a dax calendar table that start with today's date and ends with 01/01/2015

Hello Everyone,

 

Can anyone help me with creating a new table that starts with today's date every time I refresh the report.

I want to build this because I don't want unwanted dates starting from tomorrow in the Date slicer and I should be able to use between function within the slicer. 

 

I tried creating a new column with below-given code in a table known as  calendar (generated with calendarauto( ) dax) but then I can't use between a function within the slicer. This code is creating a new column within the calendar table, leaving the date starting from tomorrow as blank. 

 

Dim_Date = IF(
[Date] = Today(),
"Today",
IF(
'Calendar'[Date]=TODAY(),
"Today",
IF(
'Calendar'[Date]<TODAY(),
'Calendar'[Date]&""
))
)
 
Please help!
1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Anonymous 

Bit confusing, you asked for a calendar that starts with today's date but you mean ending with today's date.

Cal = CALENDAR(DATE(2015,1,1), TODAY())

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

4 REPLIES 4
PhilipTreacy
Super User
Super User

Hi @Anonymous 

Bit confusing, you asked for a calendar that starts with today's date but you mean ending with today's date.

Cal = CALENDAR(DATE(2015,1,1), TODAY())

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Hi @PhilipTreacy 

 

Thank you, Philip. It worked for me.

 

Cheers!

mahoneypat
Microsoft Employee
Microsoft Employee

Did you try to use CALENDAR this way instead of CALENDARAUTO?

 

NewDateTable = CALENDAR(TODAY(), DATE(2021,12,31))  // put whatever end date your want or calculate it dynamically from your fact table

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Hi Pat,

 

I tried the code it didn't work.
I want to create a calendar table which starts 01/01/2015 and ends today.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.