+ Reply to Thread
Results 1 to 9 of 9

Power Query - cumulative per month, but in one row

  1. #1
    Forum Contributor
    Join Date
    09-13-2010
    Location
    Poland
    MS-Off Ver
    365
    Posts
    204

    Power Query - cumulative per month, but in one row

    hi,

    I have faced a problem with agregating data in Power Query per customer and product in rows and sales in columns per rows. What I keep getting is it generates separate rows for each month per customer per product. What I would need, is to have one single row per customer per product.

    I do not want to make pivot table - it has to be in excel table for some reasons.

    pls find table attached
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,197

    Re: Power Query - cumulative per month, but in one row

    In PQ, select the first two columns and launch the Group By dialog. You will need to add a SUM aggregation for each of the remaining columns.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    09-13-2010
    Location
    Poland
    MS-Off Ver
    365
    Posts
    204

    Re: Power Query - cumulative per month, but in one row

    hi,

    the goal is to have it at that stage. The source table will be updated each month, so the problem will remain and keep getting back every month. I am also not final user and they will not use PQ for sure

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,197

    Re: Power Query - cumulative per month, but in one row

    Sorry - I have no clue what that comment is supposed to mean.

    If there is more that we need to know, tell us now. Make the whole scenario absolutely clear.

  5. #5
    Forum Contributor
    Join Date
    09-13-2010
    Location
    Poland
    MS-Off Ver
    365
    Posts
    204

    Re: Power Query - cumulative per month, but in one row

    hi,

    If I understand you well, with your solution the same problem will occur every next month. this table will be updated every month, so for example if I add something in march 2020, it will not appear there or I will have the second row with the same customer and product.

    The goal is to have it dynamic: columns with months (sales and cash) will appear automatically if needed and no duplicated rows

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Power Query - cumulative per month, but in one row

    Try this - it repeats the unpivot function for Sales Qty and Sales Value, then merges the two datasets.

    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  7. #7
    Forum Contributor
    Join Date
    09-13-2010
    Location
    Poland
    MS-Off Ver
    365
    Posts
    204

    Re: Power Query - cumulative per month, but in one row

    works perfectly

    the problem is solved, but just one more question - are you able to make the month columns appear in time order?

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Power Query - cumulative per month, but in one row

    Sure:

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    09-13-2010
    Location
    Poland
    MS-Off Ver
    365
    Posts
    204

    Re: Power Query - cumulative per month, but in one row

    wow, thanks

+ 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 - excel formula translation into Power Query
    By afgi in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 02-19-2020, 03:38 AM
  2. Replies: 4
    Last Post: 02-17-2020, 06:03 AM
  3. Excel Power Query Refresh or Access Query - 2nd Query Run is faster
    By Steveapa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2020, 10:16 AM
  4. [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
  5. 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
  6. [SOLVED] Power Query Filter All Rows After Prior Month
    By Tayque_J_Holmes in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-19-2018, 11:31 AM
  7. Replies: 0
    Last Post: 04-05-2018, 01:16 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