Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
What is the difference between calendar and calendar Auto. Please explain with example.
Solved! Go to Solution.
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:
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.
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!
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:
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.
Thanks for your quick and clear response. Now my confusion is clear.
Happy to help 🙂
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.
User | Count |
---|---|
81 | |
80 | |
71 | |
70 | |
54 |
User | Count |
---|---|
107 | |
99 | |
88 | |
79 | |
67 |