+ Reply to Thread
Results 1 to 7 of 7

Concatenate list of dates in power query

  1. #1
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    608

    Concatenate list of dates in power query

    Hello all,

    I have a query which is grouped and the last part is a list of dates which I'd like to join together,
    I've tried Text.Combine, but this doesn't seem to work with dates so I tride nesting Text.FromDate, no good, or I'm not using it correctly which is more than possible.

    So I'm stuck at this stage;


    Please Login or Register  to view this content.
    I've attached a workbook which has a pivot table showing what I'd like to achieve in power query.
    Attached Files Attached Files

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

    Re: Concatenate list of dates in power query

    See if this works for you. Not as neat as the Power Pivot Solution you provided.

    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
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    608

    Re: Concatenate list of dates in power query

    Hmm,
    Not quite what I was hoping for ;
    I was looking more for something like ;

    Please Login or Register  to view this content.
    but something that would work for a date

    RD

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

    Re: Concatenate list of dates in power query

    Your code in the file, slightly tweaked gets the same result as the Pivot Table.

    Please Login or Register  to view this content.

    Pivot table is the top presentation and PQ is the lower presentation

    Excel 2016 (Windows) 64 bit
    B
    C
    3
    Product Sale Dates
    4
    a 01/02/2020 , 06/02/2020 , 04/03/2020 , 01/05/2020
    5
    b 06/02/2020 , 04/03/2020 , 01/05/2020 , 03/04/2020
    6
    c 01/05/2020 , 03/04/2020
    7
    Grand Total
    8
    9
    Product What Date
    10
    a 01/02/2020, 06/02/2020, 04/03/2020, 01/05/2020
    11
    b 06/02/2020, 04/03/2020, 03/04/2020, 01/05/2020
    12
    c 03/04/2020, 01/05/2020
    Sheet: PTable.

  5. #5
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    608

    Re: Concatenate list of dates in power query

    Thanks Alan,
    that works, now all I've got to do is understand it. Not used Text.From before, apart form MS DOCS , any suggestions

    Richard.

  6. #6
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    608

    Re: Concatenate list of dates in power query

    Hi,
    meant to add is it possible to put it inside the original grouping , it certainly works,
    MS docs it's usual help , Text.From(3) = "3", well yes, but you I think are apply it to each 'step', and I can't see where it's getting
    it's source from? is it the just the Date or the entire table that's being transformed to text. I don't expect lengthy explanations but if
    you could point me in the direction of some online reading that would help.

    Thanks,
    RD

  7. #7
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    608

    Re: Concatenate list of dates in power query

    Hi alan,
    Just as a follow up ,
    I did just type the whole lot in the formula bar ,
    Please Login or Register  to view this content.
    and as you can see had to replace the Transform( _ , with the acutual [name]

    Just thought might be of interest.

    RD

+ 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. [SOLVED] Power query concatenate rows based on a separate column
    By Bloodraven in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2022, 04:36 PM
  2. [SOLVED] Power Query - Concatenate multiple variable entries
    By DystopiaRelic in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-25-2021, 01:05 PM
  3. Replies: 8
    Last Post: 10-21-2020, 03:02 AM
  4. Power Query - Extract specific data from text and concatenate with delimiter
    By Riahon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-03-2020, 11:58 AM
  5. [SOLVED] Power Query - US and UK Dates
    By andrewc in forum Excel General
    Replies: 5
    Last Post: 11-12-2019, 03:14 PM
  6. How to concatenate cell reference and text in Power Query?
    By basispoints in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2019, 11:22 AM
  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

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