Dynamic Date Table using Power Query in Power BI

Hello friends!! We’ll be learning how to create the dynamic date table using Power Query in Power BI. This tutorial will help to create dynamic date table in Power BI using Power Query. Easy and quick tutorial to follow.

Sales Table

Here is sales table I have in my Power BI.

Start Date and End Date Table

StartDate and EndDate will be created to find the first and last date from the data. Go to New Source > Bank Query and create tables using following formula

#StartDate
= #"Date.StartOfYear"(List.Min(SalesTable[SalesDate]))
#EndDate
= #"Date.EndOfYear"(List.Max(SalesTable[SalesDate]))

Date Table creation

= {Number.From(#"StartDate")..Number.From(#"EndDate")}

Once the table is created, follow the steps below

  1. Transform > To Table and it will create the table.
  2. After that change the data type to date
  3. Go to Add Column > Date > Year/Month/Day to add the columns and that’s done.

Download Power BI file here

Keep visiting Analytics Tuts for more tutorials.

Thanks for reading! Comment your suggestions and queries


One comment

Leave a Reply

Your email address will not be published. Required fields are marked *