How to Convert yyyymmdd to Date Format in Power BI?

Recently, I was working on a Power BI report. At first, everything looked fine. The data was loading properly, visuals were created, and slicers were added.

But when I started using a date column in charts and filters, I noticed some issues. The dates were not showing correctly. In some visuals, Power BI treated the date column as text, and sorting by date was not working as expected.

After checking the source data, I found that the dates were coming in different formats. Some values were like 20240115, some were 15-01-2024, and some were normal text dates. Because of this, Power BI could not understand the dates correctly.

In this tutorial, I will explain how to change date formats in Power BI. I will cover three ways to format a date column: Power Query, DAX, and model formatting options.

Change Date Format in Power BI

There are three main ways to change or control date formats in Power BI:

  1. Using Power Query Editor
  2. Using DAX formulas
  3. Using Column tools

Each method has its own use case, and choosing the right one depends on your requirements.

Method 1: Change Date Format Using Power Query Editor

In this method, I will use a simple sample dataset loaded into Power BI. The dataset contains a date column stored in different formats, such as numbers, text values, and mixed date formats. This helps explain how date issues usually appear in real projects.

dax convert yyyymmdd to date in Power BI

For this method, I will cover three different examples, each using a slightly different date format. All transformations will be done in Power Query Editor, before the data is loaded into the Power BI model.

Example 1: Convert YYYYMMDD to Date in Power BI using Power Query Editor

In the above dataset, you can see the Order Date column contains values like 20250115 and 20250203. Power BI does not recognize this format as a date. In this example, I will show you how to convert this format into a proper date using Power Query Editor.

Steps to Convert YYYYMMDD to Date:

  1. Open Power BI Desktop. Click on Transform data to open Power Query Editor.
power query convert yyyymmdd to date
  1. Select the OrderDate column. Go to the Add Column tab. Click on Custom Column.
Power BI dax convert yyyymmdd to date

Note:

Make sure the column data type is Text. If it is not Text, change it to Text from the Data Type option.

  1. In the Custom Column window, enter a column name like Formatted Date.
if Text.Length([Order Date]) = 8 then
    Date.From(
        Text.Start([Order Date], 4) & "-" &
        Text.Middle([Order Date], 4, 2) & "-" &
        Text.End([Order Date], 2)
    )
else
    [Order Date]

In my dataset, only two rows have dates in YYYYMMDD format, such as 20250115 and 20250203. All other rows have different date formats like 15-03-2025 or Apr 10 2025.

The YYYYMMDD format always contains 8 characters. Because of this, I used a condition to check the character length of the date value. Based on this condition, if the date contains 8 characters, the formula extracts the year, month, and day and converts them into a proper date. If the number of characters is not 8, the original date value is kept unchanged.

power query convert yyyymmdd to date in Power BI
  1. Then you see that a new column has been added.
Power BI power query convert yyyymmdd to date

This way, you can change the YYYYMMDD to a date in Power BI using Power Query Editor.

Example 2: Convert Text Date (DD-MM-YYYY) to Date using Power BI Power Query

In the previous example, we converted the YYYYMMDD format. Now, as you can see, the Formatted Date column is still in Text format for values like 15-03-2025 and 28-03-2025.

In this example, I will show you how to convert these DD-MM-YYYY text values into a proper Date format using Power Query Editor.

Follow the steps:

  1. In the Power Query Editor, select the Formatted Date column. Confirm that the column data type is Text.
Power BI power query yyyymmdd to date
  1. Go to the Transform tab. Click the Data Type Dropdown, then Select Date as the data type.
Convert Text Date (DD-MM-YYYY) to Date using Power BI Power Query
  1. You will see that text values like 15-03-2025 and 28-03-2025 are now converted into a proper Date format.
Power BI power query convert date to text yyyymmdd

This way, you can convert a text date (DD-MM-YYYY) to a date using Power BI Power Query.

Example 3: Format Date Using Power Query (Date Options)

In the previous examples, we converted different date formats into a proper Date data type. Now, in this example, I will show how to format the date using the built-in Date options in Power Query.

Once the column is converted to a Date type, Power Query provides several options to extract or format parts of the date, such as year, month, day, week, and more.

Steps to Format Date in Power Query:

  1. Open Power BI Desktop. Click on Transform data to open Power Query Editor.
  2. Select the Formatted Date column. Make sure the column data type is Date.
Power BI power query convert date to text yyyymmdd
  1. Go to the Add Column tab. Click on the Date dropdown option.
  2. From the list, select the required format option:
Format Date Using Power Query in Power BI
  1. From the drop-down, I select End of Month, and you can see that Power Query creates a new column.
power bi convert yyyymmdd to date

Note:

Formatting options under Add Column -> Date work only when the column data type is Date. If the column is still in Text format, these options will be disabled.

This way, you can change the date format using Power Query Editor in Power BI.

Method 2: Change Date Format Using DAX in Power BI

In this method, I will use DAX (Data Analysis Expressions) to change and format dates in Power BI.

Note:

DAX formatting is mostly used for display purposes. Some DAX formulas return text instead of a date, so they should not be used for date calculations.

Example 1: Convert YYYYMMDD to Date Using DAX in Power BI

In this example, I use a format like “yyyymmdd” (e.g., 20240310 for March 10th, 2024). I want to convert these dates to a standard format to easily analyze delivery trends.

According to this scenario, we have an Excel file named Delivery Data with columns Delivery Date.

power bi yyyymmdd to date

Follow the steps:

  1. Open Power BI Desktop and load data using the Get data option. Then, you can see data in the Data pane.
power bi convert yyyymmdd to date
  1. Now Go to Table view -> Under the Table tools tab, click New column.
Dax convert yyyymmdd to date in Power BI
  1. In the formula bar, put the following DAX expression. Then click the Commit button.
DeliveryDate =
DATE(
    VALUE(LEFT('DeliveryData'[Delivery Date], 4)),
    VALUE(MID('DeliveryData'[Delivery Date], 5, 2)),
    VALUE(RIGHT('DeliveryData'[Delivery Date], 2))
)

Where:

  • DeliveryDate = This is the name we’re giving to the new column that will contain the date format.
  • DATE = This function in DAX constructs a date value from the year, month, and day components.
  • VALUE(LEFT(‘DeliveryData'[Delivery Date],4)) = This part extracts the leftmost 4 characters (representing the year) from the “Delivery Date” column in the “DeliveryData” table and converts them into a numeric value.
  • VALUE(MID(‘DeliveryData'[Delivery Date],5,2)) = This section extracts the characters starting from the 5th position up to 2 characters long (representing the month) from the “Delivery Date” column and converts them into a numeric value.
  • VALUE(RIGHT(‘DeliveryData'[Delivery Date],2)) = Here, it takes the rightmost 2 characters (representing the day) from the “Delivery Date” column and converts them into a numeric value.
power bi convert yyyymm to date
  1. You see the DeliveryDate created in the Table view.
dax date format yyyymmdd in Power BI

This way, we can use DAX to convert “yyyymmdd” dates to a standard date format in Power BI. This lets you analyze delivery trends and make data-driven decisions to improve logistics operations.

Example 2: Format Date for Display Using DAX in Power BI

In this example, the date column is already in the correct date format. We will use DAX to change how the date is displayed in the report.

To do this, follow the steps below:

  1. In Power BI Desktop. Go to Table view. Select the table that contains the date column (for example, DeliveryData).
power query format date as yyyymmdd in Power BI
  1. Under the Table tools tab, click New column. In the formula bar, enter the following DAX formula:
Delivery Date Text = FORMAT([DeliveryDate], "dd-MMM-yyyy")
Format Date for Display Using DAX in Power BI
  1. Press Enter. A new column is created with the formatted date.
Power BI Format Date for Display Using DAX

This way, you can format the date using DAX in Power BI.

Method 3: Change Date Format from Column tools in Power BI

In this method, we will change the date format directly from the Column tools in Power BI. This method is useful when the date column is already in the correct Date data type, and you only want to change how the date is displayed in the report.

For this method, I am using the dataset below, where the date column is already in Date format.

Power BI Change Date Format from Column tools

I will change only the display format of the date using the Column tools in Power BI. This method does not change the actual data; it only changes the display format.

To do this, follow the steps below:

  1. Open the Power BI Desktop and load the above data, then you can see the data in the Data section.
Power BI Date Format Hack to Change the Date in Any Format

Note:

In the Data section, check whether the date column displays a calendar icon. If yes, then follow the below steps. If no, first change the date format in that column.

  1. Click on the date column you want to format. On the top menu, go to the Column tools tab. In the Format dropdown, choose the required format, such as:
Change Date Format from Column tools in Power BI
  1. Now I want the dd mmmm yyyy format, so I selected the 3 options based on your requirement. The date format is updated immediately.
  2. To check this, go to the table view, select the table, and you can see the date format has changed.
Change Date Format from Column tools  Power BI

This way, you can change the date format from Column tools in Power BI.

Conclusion

In this tutorial, I explained how to change date formats in Power BI using different methods. I started by showing why date format issues happen when data comes from different sources.

First, I used Power Query Editor to convert dates like YYYYMMDD and DD-MM-YYYY into a proper date format. I also showed how to format dates using the built-in Date options in Power Query.

Next, I used DAX to convert dates and format them for display purposes. I explained that DAX is mainly used for formatting and that some DAX functions return text instead of a date.

Finally, I showed how to change the date format using Column tools in Power BI. This method is useful when the date column is already in the correct date format, and only the display format needs to be changed.

Additionally, you may like some more Power BI articles:

Leave a Comment

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App