Power Query Calendar

11 April 2023
Eugene Lebedev

Eugene Lebedev is a Power BI consultant by background. Before founding Vidi Corp in 2021 he created Power BI reporting for Autodesk. His Power Bi reports were used by VPs of Finance and C-suite of Autodesk. As part of Vidi Corp, Eugene created dashboards for Google, Teleperformance, Delta Airlines and 200+ clients worldwide.

In Power BI, a calendar table is a table that contains all the dates that you want to use for analysis in your data model. It is a standard dimension table that can be used to reference dates in the data model and to leverage time intelligence functions.

There are several benefits of having a calendar table in Power BI:

1. Time-based analysis: A calendar table allows you to aggregate your dates, such as by month, quarter, or year. 

2. Simplified report building: Having a calendar table means that you only need to aggregate your dates into month/quarter/year once. This is much better than doing these aggregations multiple times for each table in your model. 

3. Improved data modeling: Having a calendar table usually reduces the overall amount of data in your data model. This means that your reports will load faster. 

4. Customisable: A calendar table can be customised to meet your specific needs. For example, you can add custom columns to track holidays, special events, or working days.

5. Flexibility: A calendar table can be used in a variety of applications, from simple reports to more complex data models. It can also be easily shared among team members, ensuring consistency across reports and analyses.

See also  Connect Salesforce to Power BI and Create a Dashboard

Let’s look into what each of these features does in more detail.

Usually, the calendar table is available in the data model and flows through the dataset. In the absence of a calendar table in the data model, it can be created in Power BI Desktop. There are two ways to create it:

1. Using Power Query

2. Using DAX

To see how you can optimise your reporting with Power Query, make an enquiry here. 

Power Query Calendar

A big advantage of having your calendar table inside of Power Query is that you can copy the M code from one file to another. This means that you don’t have to recreate your calendar table column by column in a new report!

Let’s look into step by step creation of a calendar table in Power Query : 

  • Open Power Query on the Power BI desktop (Click on the Transform data tab).

Microsoft Power Platform

Everything you Need to Know

Of the endless possible ways to try and maximise the value of your data, only one is the very best. We’ll show you exactly what it looks like.

To discuss your project and the many ways we can help bring your data to life please contact:

Call

+44 7846 623693

eugene.lebedev@vidi-corp.com

Or complete the form below