Dates in Power BI

Dates in Power BI

In this article, I’ll show you how to create a calendar table in M (Power Query) and in DAX.

In Power BI, the highly recommended approach from many experts is to create a date table when working with dates. I’ve worked without it and it’s definitely not a good idea. It gave me a headache and needless suffering.

Image for post

Image by author

The date table is important! Here are 3 reasons why.

Date Calculations — DAX needs a date table to make date calculations! Those SAMEPERIODLASTYEAR, LASTQUARTER or DATESBETWEEN type calculations wouldn’t work without it. Maybe it will, but it will just be very convoluted. Why hurt your head?

Weekends/Holidays — if you need to exclude holidays in your calculations, and you are doing it without a date table? It would be very difficult.

Different Granularity — Sometimes, you need to put together a comparison between a table that is based on month, while another is based on days. You need something to join them so you can report adequately.

In this article, I’ll show you how to create a calendar table in M (Power Query) and in DAX.

Let’s get started!

data power-bi data-science data-analysis data-visualization

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Tableau vs Power BI: Comparing the Data Visualization Tools

In analytics, Tableau is the leading visualisation tool. Its rich analytical features and attention to data details are the reason behind its popularity. Power BI, on the other hand, is preferred by professionals who are more comfortable with...

Explore your JIRA Data with Power BI

JIRA Software provides bug tracking, issue tracking, and project management capabilities for teams and organizations. The JIRA content pack for Power BI helps you quickly import JIRA data so you can get an instant dashboard to analyze workloads...

Managing your Data with Microsoft’s Power BI

In a world where the sheer amount of data is often overwhelming, the ability to interrogate and organise data to make meaningful business decisions is more important than ever. Microsoft have created Power BI to enable every day users to use the...

Push Card visuals to a new level in Power BI

Push Card visuals to a new level in Power BI. Bring new life to traditional Power BI visuals and learn how to achieve expand/collapse functionality with a simple workaround

Exploratory Data Analysis is a significant part of Data Science

Data science is omnipresent to advanced statistical and machine learning methods. For whatever length of time that there is data to analyse, the need to investigate is obvious.