Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi, I want to know what is the best way to create a calendar table and why a calendar table is that necessary to create. How to create one in query editor?
Solved! Go to Solution.
@azeemnazim - Calendar tables are just a common dimension in many data models and Power BI wants you to use a star schema data model. You need a calendar table for many time intelligence functions to operate.
But, if you don't want one, there are other ways. You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
Try using the following code for creating a calendar which includes the "FullDate4Sort" column to sort calendar in ascending dates. Feel free to add whatever columns you need with the Format and Date functions.
@azeemnazim - Calendar tables are just a common dimension in many data models and Power BI wants you to use a star schema data model. You need a calendar table for many time intelligence functions to operate.
But, if you don't want one, there are other ways. You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
Hey @azeemnazim ,
Creating a calender table is very easy using this m query:
List.Dates(start as date, count as number, step as duration)
List.Dates(#date(2011, 12, 31), 5, #duration(1, 0, 0, 0))
| 12/31/2011 12:00:00 AM |
| 1/1/2012 12:00:00 AM |
| 1/2/2012 12:00:00 AM |
| 1/3/2012 12:00:00 AM |
| 1/4/2012 12:00:00 AM |
Why calender tables is required?
If your problem is solved then accept this reply as solution.
Thank you
Hey,
this article provides a lot of examples on how to use a calendar table:
https://www.daxpatterns.com/time-patterns/
This article explains why one should not use a "one-table" solution and strive for a star schema data model, where a calendar table is just one of the dimension tables:
https://www.sqlbi.com/articles/understanding-dax-auto-exist/
Here is an example creating a calendar table using power query:
Regards,
Tom
@azeemnazim , refer these
calendar
https://radacad.com/create-a-date-dimension-in-power-bi-in-4-steps-step-1-calendar-columns -- power query/ M way
https://radacad.com/create-a-date-dimension-in-power-bi-in-4-steps-step-3-public-holidays
https://radacad.com/create-a-date-dimension-in-power-bi-in-4-steps-step-2-fiscal-columns
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.andredevelopment.com/en-US/community/blogs/powerbi/working-days-holidays-calendar/
Any month calendar using dax
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 90 | |
| 78 | |
| 66 | |
| 65 |