+ Reply to Thread
Results 1 to 6 of 6

Power Query to Split a Column

  1. #1
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Power Query to Split a Column

    Hi,

    I have data in the attached workbook, arranged as a Table, and would like to use Power Query to split the data in column A into three columns with the person's name in one column, the date in the next and the region in the final column.

    I have achieved this in Power Query Editor by splitting the column by delimeters (using " / " as the delimiter).

    However, when I change the data type of the data in the date column from text to date, most of the dates are converted to "Error"

    Can someone please tell me what I'm doing wrong?

    Thanks!
    Attached Files Attached Files
    Last edited by andrewc; 07-27-2019 at 01:01 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Power Query to Split a Column

    Here is the Mcode I used to get the data into three columns formatted correctly. I split on a space and not a "/". Then deleted the two columns holding the slash.

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Re: Power Query to Split a Column

    Hi,

    Thanks for the response, Alan!

    That yields the same results as I was getting, with "Error" for many of the dates.

    Could the problem be because the "dates" in the original data are in a MM/DD format while my PC defaults to DD/MM?

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Power Query to Split a Column

    Interesting because I get no errors. Here is a short sample of what the results look like for me.

    Data Range
    A
    B
    C
    1
    Description.1
    Description.3
    Description.5
    2
    Carlota
    5/5/2016
    West
    3
    Aspen
    4/2/2016
    South
    4
    Yanaki
    5/2/2016
    South
    5
    FlatTop
    4/11/2016
    South
    6
    Carlota
    5/21/2016
    South
    7
    Carlota
    5/15/2016
    East
    8
    Carlota
    5/19/2016
    West
    9
    Yanaki
    5/6/2016
    East
    10
    Yanaki
    5/7/2016
    East
    11
    Quad
    5/20/2016
    West
    12
    Quad
    4/29/2016
    East
    13
    Quad
    4/18/2016
    South
    14
    FlatTop
    4/25/2016
    West
    15
    Yanaki
    5/30/2016
    South
    16
    Carlota
    5/4/2016
    East
    17
    Carlota
    5/18/2016
    West
    18
    FlatTop
    4/9/2016
    West
    19
    Quad
    5/6/2016
    South
    20
    Quad
    5/22/2016
    East
    21
    FlatTop
    4/28/2016
    West
    22
    Aspen
    5/16/2016
    South
    23
    FlatTop
    5/3/2016
    East
    24
    Carlota
    4/28/2016
    East
    25
    Aspen
    5/18/2016
    West


    Have checked to see what your regional settings are in PQ? They may be set differently than your Windows Regional settings.
    Last edited by alansidman; 07-27-2019 at 08:32 AM.

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Power Query to Split a Column

    Pleased try



    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Re: Power Query to Split a Column

    Thanks.

    Changing the regional settings in PQ did the trick

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Custom Permutations Column in Power Query from two columns in the same Query
    By PaintPaddy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2019, 02:48 PM
  2. [SOLVED] Move From Column To Row - Power Query?
    By Gtrtim112 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 05-31-2019, 05:04 PM
  3. [SOLVED] Power Pivot does not load new column added in Power query
    By ibuhary in forum Excel General
    Replies: 12
    Last Post: 02-19-2019, 03:53 AM
  4. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  5. Adding Column in Power Query
    By fuerte in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-28-2018, 12:39 PM
  6. Adding Column in Power Query
    By fuerte in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2018, 11:15 AM
  7. Power Query - add column with Table name
    By zico8 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-11-2017, 12:58 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1