Below is the syntax to create a Time Dimension Table in Power Query

I had a requirement where I needed to create a Time Dimension for a customer. Most of the time I only need the date. Upon searching I could not find a resource where they had created the time dimension only using Power Query.

Reference: https://docs.microsoft.com/en-us/powerquery-m/list-times

  • What I did was I opened my Power BI Desktop file and went into the Query Editor
  • I then clicked on Get Data and selected Blank Query
  • I renamed the Query to Time
  • I then clicked on the Advanced Editor to allow me to paste in my code
  • I then pasted in the code below

  • I then clicked Ok
  • And below I could then see the output of my table.
  • My final step was to click Close and Apply
  • I then created a simple report where I could see some of the table properties

Conclusion

I have shown in my blog post how to create a time dimension using only the Power Query Editor.

If there are any comments or suggestions, please let me know in the section below.

If you would like a copy of the file you can get it here: Time Dimension.pbix

Thanks for reading.