+ Reply to Thread
Results 1 to 3 of 3

Power Query Grouping Column as list

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

    Power Query Grouping Column as list

    Hi,
    I've managed to get the result I wanted but aren't sure how ;
    I've attached workbook showing all examples;

    I've grouped some data all rows and then within that wanted to do a running total using list sum with list firstN and index.

    this is what I've got,

    Please Login or Register  to view this content.
    What I would like some help in understanding is if you just put in [Units]

    Please Login or Register  to view this content.
    you get a list but if you do the same with index you get an
    error? it has to be prefixed with the function ; can someone explain or point me in the direction of information other than MS docs.
    also I realise this is probably not the best way of approaching this.


    Richard.
    Attached Files Attached Files

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

    Re: Power Query Grouping Column as list

    It's a question of scope. When you use [Units] there, it's really _[Units], which is fine since the Units column exists in the initial table being referred to in the each function. The Index column is not in the original table, so _[Index] won't work. That's why you have to specify A[Index] instead.
    Everyone who confuses correlation and causation ends up dead.

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

    Re: Power Query Grouping Column as list

    Thanks, I'd sought of figured it was something along the lines that _[Units] or whatever is part of the original and index wasn't.

    What I'd tried first was to to it two stages, it was included in attachment,

    Please Login or Register  to view this content.

    What first a group is added for the index and then another group for the sum as another column, in this case the index was straightforward but I could not

    the units as a list I'd tried with each and _ , nothing, declare a variable (A)=> so A[Units] and referred to the name of previous table group column All;

    [ALL] [Unit] ,

    I've got as far as using (A)=> { A [Units] } , which returns 'list' , but each row is a list of one value so List .Sum just returns one value.

    Thanks again for the help,
    Richard.

+ 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 Grouping undos sort
    By KerahJoy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-18-2022, 09:12 AM
  2. [SOLVED] Power Query Grouping Lists displays
    By JyothiGrace in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-17-2022, 08:35 AM
  3. Grouping Power Query Column
    By nick3516 in forum Excel General
    Replies: 5
    Last Post: 11-06-2022, 01:30 PM
  4. [SOLVED] Excel Power Query Grouping list
    By Dicken in forum Office 365
    Replies: 9
    Last Post: 08-15-2022, 08:21 AM
  5. [SOLVED] Power Query extract values from list column with nulls
    By Imbizile in forum Excel General
    Replies: 4
    Last Post: 02-04-2021, 10:00 AM
  6. Data grouping in Power Query
    By hudson andrew in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2020, 10:44 AM
  7. Help with grouping in power query
    By stephme55 in forum Excel General
    Replies: 1
    Last Post: 07-26-2016, 03:09 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