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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Rsing
Frequent Visitor

DAX function

What is the difference between calendar and calendar Auto. Please explain with example.

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @Rsing 

The CALENDAR and CALENDARAUTO functions in DAX are both used to generate date tables. However, there are some key differences between the two functions.

CALENDAR

The CALENDAR function takes two arguments: a start date and an end date. It returns a table with a single column named Date that contains all of the dates between the start date and the end date, inclusive.

CALENDAR(StartDate, EndDate)
For example, the following code will create a date table that contains all of the dates between January 1, 2020 and December 31, 2020:

Calendar(Date(2020,1,1), Date(2020,12,31))
CALENDARAUTO

The CALENDARAUTO function does not take any arguments. It returns a table with a single column named Date that contains all of the dates in the current model. The date range is calculated automatically based on the data in the model.

CALENDARAUTO()
For example, if the current model contains a table of sales with a Date column, the CALENDARAUTO function will return a table that contains all of the dates in the Date column.

Key Differences

The main difference between the CALENDAR and CALENDARAUTO functions is that the CALENDAR function allows you to specify a custom date range, while the CALENDARAUTO function automatically calculates the date range based on the data in the model.

Here is a table that summarizes the key differences between the two functions:

Ritaf1983_0-1715223632703.png

Also, take a look at the linked video :

https://www.youtube.com/watch?v=b23bk6TcXak

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

View solution in original post

5 REPLIES 5
Uzi2019
Super User
Super User

Hi @Rsing 

 

Refer below video for better undertanding with proper example
https://www.youtube.com/watch?v=pIIk42R4ex4

https://www.youtube.com/watch?v=wyl7Lvj2EJ8

 

I hope I answered your questioned!

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
Ritaf1983
Super User
Super User

Hi @Rsing 

The CALENDAR and CALENDARAUTO functions in DAX are both used to generate date tables. However, there are some key differences between the two functions.

CALENDAR

The CALENDAR function takes two arguments: a start date and an end date. It returns a table with a single column named Date that contains all of the dates between the start date and the end date, inclusive.

CALENDAR(StartDate, EndDate)
For example, the following code will create a date table that contains all of the dates between January 1, 2020 and December 31, 2020:

Calendar(Date(2020,1,1), Date(2020,12,31))
CALENDARAUTO

The CALENDARAUTO function does not take any arguments. It returns a table with a single column named Date that contains all of the dates in the current model. The date range is calculated automatically based on the data in the model.

CALENDARAUTO()
For example, if the current model contains a table of sales with a Date column, the CALENDARAUTO function will return a table that contains all of the dates in the Date column.

Key Differences

The main difference between the CALENDAR and CALENDARAUTO functions is that the CALENDAR function allows you to specify a custom date range, while the CALENDARAUTO function automatically calculates the date range based on the data in the model.

Here is a table that summarizes the key differences between the two functions:

Ritaf1983_0-1715223632703.png

Also, take a look at the linked video :

https://www.youtube.com/watch?v=b23bk6TcXak

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

Thanks for your quick and clear response. Now my confusion is clear.

Happy to help 🙂

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

Rsing,

 

Check this link out: https://www.sqlbi.com/tv/calendar-calendarauto-dax-guide/


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)

 

P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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