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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
RohithGn
Helper I
Helper I

Dynamic Dim date table - Dax

Hi,

 

I am trying to create a Dimdate table in power bi and the table should contain all dates from today's month last year till today. I have used CALENDAR(DATE(YEAR(TODAY()),MONTH(TODAY())-13,DAY(TODAY())),today()) however it is not solving my purpose as the result contains dates from today's date 13 months ago till today. I need the table to contain dates from 1st of same month last year till today

 

Eg - as today is 10/13/2017, the table contains data from 10/13/2016 till 10/13/2017 but i need my table to contain data from 10/1/2016 till 10/13/2017

 

Thanks in advance

 

Regards,

Rohith

1 ACCEPTED SOLUTION

Hey,

 

I just copied this statement from sample table, on a 2nd look I realized that the CALENDAR(<Startdate>, <Enddate>) function was missing, but now it's complete

Table = CALENDAR(
DATE(YEAR(TODAY())-1,MONTH(TODAY()),1), TODAY())

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

4 REPLIES 4
TomMartens
Super User
Super User

Hey,

 

try this

CALENDAR=
DATE(YEAR(TODAY())-1,MONTH(TODAY()),1), TODAY())

Hopefully this is what you are looking for

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hi Tom,

 

Thanks for quick response however I am getting an error. Played around with the braces still no luck 

 

Capture-pbi.PNG

Regards,

Rohith 

 

 

Hey,

 

I just copied this statement from sample table, on a 2nd look I realized that the CALENDAR(<Startdate>, <Enddate>) function was missing, but now it's complete

Table = CALENDAR(
DATE(YEAR(TODAY())-1,MONTH(TODAY()),1), TODAY())

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Works as expected Thanks a ton!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.