+ Reply to Thread
Results 1 to 2 of 2

Power Query - Column Code Help

  1. #1
    Registered User
    Join Date
    10-01-2020
    Location
    USA
    MS-Off Ver
    MS Office 365 Pro Plus version 2002
    Posts
    3

    Power Query - Column Code Help

    Hello,

    I have a column that pulls the data in this format... the dates are dates and the other is days late or day early depending on if there is a negative. I am needing to keep both parts in the same column; however, I need to change the format for the date to MM/DD/YYYY. Unfortunately, the Column from example is not detecting what I need. And I am not certain how to write the code for it. I do have "potential" parts to use, but do not know enough about coding in Power Query to make it work for my needs. For the date, I was thinking I could use text.middle Text.Middle([#"MyColumnName"], 6,2, "/" Text.Middle [#"MyColumnName"], 9,2 "/" Text.Middle [#"MyColumnName"], 1,4) to extract the middle, then last, then first sections for the date that are needed. Then I would need to join them with the "/" somehow. And then I need to else... write the text instead if it does not contain the "-".... I am not sure if the logic is on point and would really appreciate any help!

    2020-05-08
    2020-04-23
    -117
    2020-05-04
    2020-05-11
    2020-05-11
    -90
    2020-05-11
    2020-04-29
    2020-05-25
    2020-05-11
    -85
    -85
    -85
    2020-05-20
    2020-08-05
    2020-08-27
    2020-08-13
    -34
    -34
    2020-07-10
    -26

  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,875

    Re: Power Query - Column Code Help

    Please read the yellow banner at the top of this page on how to attach a file.

    I ask because when I copy and paste your column of data to Excel it automatically converts them to dates and I cannot then replicate your issue.
    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

+ 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. Replies: 10
    Last Post: 06-25-2020, 12:19 AM
  2. [SOLVED] Power Query - excel formula translation into Power Query
    By afgi in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 02-19-2020, 03:38 AM
  3. Replies: 4
    Last Post: 02-17-2020, 06:03 AM
  4. 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
  5. [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
  6. 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
  7. code to refresh power query not working ..
    By Hassan1977 in forum Excel General
    Replies: 0
    Last Post: 08-31-2016, 12:31 PM

Tags for this Thread

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