How can I convert a date into the YYYYMMDD format using Power BI?

In Power BI, you can convert a date into the YYYYMMDD format by using the FORMAT function and specifying the desired format code. First, create a new column or measure that contains the date you want to convert. Then, use the FORMAT function and specify the date column/measure as the first argument and “YYYYMMDD” as the second argument. This will convert the date into the desired format and display it in the new column or measure. You can also use this method to convert dates into other formats, such as DD/MM/YYYY or MM/DD/YYYY.


You can use the following syntax in DAX to convert a date to a YYYYMMDD format in Power BI:

Date_New = FORMAT('my_data'[Date], "YYYYMMDD")

The following example shows how to use this syntax in practice.

Example: Convert Date to YYYYMMDD Format in Power BI

Suppose we have the following table in Power BI named my_data that contains information about total sales made on various dates by some company:

Suppose we would like to convert the values in the Date column to a YYYYMMDD format.

To do so, click the Table tools tab, then click the icon called New column:

Then type the following formula into the formula bar:

Date_New = FORMAT('my_data'[Date], "YYYYMMDD")

This will create a new column named Date_New that shows each of the corresponding date values from the Date column represented as text values in the format YYYYMMDD:

For example:

  • January 1, 2024 is shown as 20240101.
  • January 5, 2024 is shown as 20240105.
  • February 15, 2024 is shown as 20240215.

And so on.

Note: You can find the complete documentation for the FORMAT function in DAX .

Additional Resources

The following tutorials explain how to perform other common tasks in Power BI:

x