From the course: Power BI Data Methods (2019)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating date tables

Creating date tables

From the course: Power BI Data Methods (2019)

Start my 1-month free trial

Creating date tables

- [Instructor] Date calendar tables are immensely useful in Power BI, and we can easily create them through custom M code. In the M language objects Power BI file, let's create a new list directly in the formula bar using a blank query. Let's put a date formula into the formula bar. To the "datetime date of the date time.local effects now. And hit enter. We get an error message when we try to create this list. Therefore, in order for this query to work, we need to use a work-around. In the same formula bar put "=1..100" and hit enter. This creates new list of contiguous numbers from 1 to 100. We convert this to a table, choose to use no delimiters. We then change the data type to date. Let's rename this column "dates" and the query "dates table". Now we need to make changes in the advanced editor window in the M Pub. Let's add a few extra rows in front of the source step. We set up the…

Contents