+ Reply to Thread
Results 1 to 7 of 7

Replacing values in Power Query

  1. #1
    Forum Contributor
    Join Date
    07-08-2014
    Location
    israel
    MS-Off Ver
    office 365
    Posts
    101

    Replacing values in Power Query

    Hey

    I grouped different values in the query
    Some of the column headings are in dd/mm/yyyy date format
    I am trying to change to another format so that the value is recognized as text for example 01.24.2024

    I understand that I need to loop over each table in the query but Unfortunately without success

    something like - .... each Text.Replace(_,"/","-")

    Thanks in advance

    PQ.jpg

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Replacing values in Power Query

    There is a chance that the dates are stored in date not in text format, because they are left-aligned (I noted your location: israel, so you use right-to-left arrangement).
    If that hint is not enough, see yellow box above and add just 3-4 tables sample data (not your real data, but similar data where there are your dates
    Best Regards,

    Kaper

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,013

    Re: Replacing values in Power Query

    I assume those are meant to be column headers, so you'd probably want to promote the first row to headers, then you can use Table.TransformColumnNames
    Everyone who confuses correlation and causation ends up dead.

  4. #4
    Forum Contributor
    Join Date
    07-08-2014
    Location
    israel
    MS-Off Ver
    office 365
    Posts
    101

    Re: Replacing values in Power Query

    Thank you

    The query accepts dates as column headers from different sheets in the file and should
    Consolidate all sheets into one new sheet

    When the dates are in the format dd.mm.yyyy they are probably recognized as text and go to the new sheet like I wanted.

    When the dates are in the format dd/mm/yyyy they are recognized as a date and do not go to the new sheet as I wanted

    I understand that i need to loop over each table separately and replace "/" with "." Then the query will work as I want

    In the attached file you can see that the columns with a date with format dd/mm/yyyy are loaded into the output from the query without the column name as date but exist as Column4, Column3...

    Thanks again
    Attached Files Attached Files

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,013

    Re: Replacing values in Power Query

    Change the first added custom step to:

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    07-08-2014
    Location
    israel
    MS-Off Ver
    office 365
    Posts
    101

    Re: Replacing values in Power Query

    Thank you

    Works great!!!!

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,013

    Re: Replacing values in Power Query

    Glad we could help, and thanks for the rep.

+ 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: 1
    Last Post: 07-14-2023, 10:15 AM
  2. [SOLVED] Error in replacing bulk values in Power query
    By Mayasak in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-26-2023, 12:39 PM
  3. [SOLVED] Power Query - Replacing null values
    By daithy in forum Excel General
    Replies: 20
    Last Post: 01-20-2023, 04:24 AM
  4. Power Query - refreshing data but adding to table, not replacing existing data
    By zakazano in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-05-2022, 08:49 AM
  5. [SOLVED] Replacing Values in Text Strong Power query
    By JyothiGrace in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-30-2022, 09:59 AM
  6. Replies: 0
    Last Post: 07-03-2018, 05:33 PM
  7. 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

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