Create Dim Date Using ChatGPT

Do you like to create a dim date table in Power BI but you don’t know anything M Power Query language?

Don’t worry! It’s a piece of cake with AI technology. Just try ChatGPT.

If you’re new to my blog or YouTube channel I recommend you to read and watch all the previous tutorials. I’ve already created two another blog posts and videos on how to create Dim Date table and add Fiscal info to the Dim Date table. But today I want to talk about the new AI tool, ChatGPT. And how we can use it to create a dim date table without M Power Query knowledge.

What is ChatGPT?

ChatGPT is an Open AI tool released for the first time in November 2022, and it interacts with users through conversations. ChatGPT stands for Chat Generative Pre-trained Transformer.

How to use it?

The first thing you should do is going to the google page, and search for ChatGPT. You can click on the first link and it opens up this page.

ChatGPT opening Page dim date

You can click on TRY CHATGPT to start working with this tool.

If it’s the first time you’re using this tool, you should create an account. It asks you some personal information, and after signing in you will be directed to this page.

ChatGPT search page dim date

Now in the text box at the bottom of this window, you can ask any question you like, and you will receive your answers using AI technology.

Now, we’re going to ask: “I want an M code in Power Query to generate a date table from 2020 to 2025”. and press enter.

Once I press enter, the AI tool automatically starts writing a script in M Power Query language which we can use to create the dim date table.

Ask ChatGPT to create dim date

Now you can see the code provided for you. From top right corner of the code box, I click on copy code, and then I will go back to the Power BI file.

Use ChatGPT Code in Power BI to Create Dim Date

Let’s open the Transform Data. Now from New Sources on Home tab, choose a Blank Query.

Blank Query Power BI chatGPT dim date

Once it created, go to the Advanced Editor, and replace the code here. And press on Done.

Edit M Power Query Code dim date ChatGPT

Boom! So easy! Now you have a date table.

Dim Date table using ChatGPT

Now you can change the Table name to Dim Date. And you can also add other columns. To do this, go to the Add column tab, select Date column, and from Date & Time section, choose Date, and add whatever columns you like.

If you like to investigate more I recommend you strongly to read the other articles on this blog and watch the related videos on YouTube channel on how to create dim date table and fiscal date table in Power BI.

It is really easy to create a dim date table in Power BI using ChatGPT without even knowing a word about M Power Query language.

If you want to explore more about the code ChatGPT created for you, you can also go back to the ChatGPT website, and write: “would you please explain this code to me step by step?”.

ChatGPT description for dim date query

And amazing. Wait for some seconds and you can see ChatGPT describes any line of code created for you.

If you liked this blog write your comments below. And it would be so great to watch the videos on YouTube channel for deep understanding.

Leave a Comment

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