How to change yyyymmdd to date in power query?
Changing YYYYMMDD format to a proper date in Power Query is pretty straightforward! Here's how I do it:1. Select the column with your YYYYMMDD values2. Go to the "Transform" tab3. Click on "Data Type" and select "Date" (or "Date/Time" if you need time component)4. If that doesn't work automatically, use "Using Locale" and specify the formatAlternatively, you can use a custom column with this formula:= Date.FromText(Text.From([YourColumn]), "yyyyMMdd")
This has saved me tons of time when working with exported data that comes in that numeric date format!
I deal with this conversion all the time with financial data! The method that works most reliably for me is: Using Text to Columns: Right-click the column → Transform → Format → Add Prefix/Suffix if needed Custom column approach: Add Column → Custom Column → Use formula: = #date(Number.IntegerDivide([DateColumn], 10000), Number.Mod(Number.IntegerDivide([DateColumn], 100), 100), Number.Mod([DateColumn], 100))
For text fields:* If your YYYYMMDD is stored as text, use: = Date.FromText([DateColumn], "en-US")
The key is ensuring Power Query recognizes your initial format correctly. Sometimes changing the data type to text first, then applying the date conversion works better than trying to convert directly from numbers. Microsoft's Power Query documentation has great examples for these date transformation scenarios.