Power Query Problems

How to Convert Website Dates to YYYY-MM-DD in Power Query

Natalie TaylorNatalie Taylor Oct 29, 2026 871 views

Question details

The user needs to convert imported website dates (e.g., MM/DD/YY) into a valid date data type and display them in the YYYY-MM-DD format.

How to Convert Website Dates to YYYY-MM-DD in Power Query
Product
Power Query / Excel
Device & OS
not provided
Scenario
Importing data from a website where dates are stored as text in regional formats and need to be standardized into a uniform YYYY-MM-DD layout.
Observed behavior
The imported dates are recognized as text strings or return errors when converted, preventing proper sorting, filtering, and uniform YYYY-MM-DD formatting.
Before you start

Ensure your dataset is loaded into the Power Query Editor and identify the specific column containing the imported website dates.

Solution 1Recommended

Convert Text to Date Using Locale Settings

This is the most reliable method for converting regional text dates (like MM/DD/YY) into valid date values without writing custom code.

Website dates often import as text based on the source's regional format (e.g., US format MM/DD/YY). By using the 'Using Locale' feature, you tell Power Query exactly how to read the incoming text so it can safely convert it to a universal Date data type.

1
Access the Locale Settings

Right-click the column header containing your text dates in the Power Query Editor, hover over 'Change Type', and select 'Using Locale...'.

2
Configure Data Type and Locale

In the pop-up window, set the 'Data Type' drop-down to 'Date'. Set the 'Locale' drop-down to the region matching your source data (e.g., 'English (United States)' for MM/DD/YY).

3
Apply the Conversion

Click 'OK'. The column will now be converted to a proper Date data type without throwing errors.

4
Format in Excel

Click 'Close & Load' to return the data to your spreadsheet. Select the date column, right-click and choose 'Format Cells', go to 'Custom', and type 'yyyy-mm-dd' to set the visual display format.

Convert Text to Date Using Locale Settings
Best Practice: Always keep dates as Date data types in Power Query and handle the YYYY-MM-DD visual formatting in your spreadsheet application.
WPS Spreadsheet Solution

Format Dates Easily in WPS Spreadsheet

You don't always need complex Power Query formulas to fix imported website dates. WPS Spreadsheet offers intuitive, built-in tools like Text to Columns and Custom Formatting to quickly convert and format your dates to YYYY-MM-DD without writing code.

  1. 1. Select Your Data: Highlight the column in your spreadsheet containing the imported website dates.
  2. 2. Use Text to Columns: Go to the 'Data' tab on the ribbon and click on 'Text to Columns'.
  3. 3. Convert Text to Date: Proceed to Step 3 of the wizard. Choose 'Date', select the 'MDY' format from the drop-down, and click 'Finish'.
  4. 4. Open Format Cells: Right-click the newly converted column and select 'Format Cells'.
  5. 5. Apply Custom Format: Go to the 'Custom' category, enter 'yyyy-mm-dd' in the Type box, and click 'OK' to apply the formatting.
Directly convert text dates using the intuitive Text to Columns wizard.Apply custom YYYY-MM-DD formatting in seconds.Fully compatible with Microsoft Excel file formats (.xlsx, .csv).Free, lightweight, and fast alternative for everyday data processing.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Power Query return an error when converting my dates?

This usually happens because the date format of the source text (e.g., MM/DD/YY) does not match your computer system's default regional settings. Using 'Change Type > Using Locale' allows you to specify the exact origin format (like English - United States), which prevents conversion errors.

Can I format the date as YYYY-MM-DD directly inside Power Query without converting to text?

Power Query's 'Date' data type does not store display formatting; it automatically uses your system's default short date format visually. To display YYYY-MM-DD as a functional date, you should load the converted Date data type into your spreadsheet and apply custom cell formatting there.

What is the difference between Date.FromText and Date.ToText in M-code?

Date.FromText parses a text string and turns it into a standard Date data type, which is necessary for chronological sorting and calculations. Date.ToText does the exact opposite—it takes a valid Date data type and converts it back into a text string with a specified display layout (like 'yyyy-MM-dd').