Results 1 to 6 of 6

Power Query Sum within grouped data

Threaded View

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

    Power Query Sum within grouped data

    Hello,
    Work book attached with examples.

    I'm trying to sum figures in grouped data for each group, so I have the groped data ;


    Table.Group( #"Integer-Divided Column",{"Index"}, {{"ALL", each _ }} )

    and I wan to sum a 'sales' column within the group, so if I were adding an index to to each grouping i'd put this after each ;

     Table.Group(#"Integer-Divided Column", {"Index"}, {{"Count", each Table.AddIndexColumn(_ , "IndexG", 1, 1, Int64.Type ) }} )
    So I'd like to use list.sum in a similar way, but can't get it to work,

    each _ List.Sum( [Sales] ) }} ) , List.Sum( _ [Sales] ) etc. don't seem to work.


    i've exapneded one group and done the calculation on that group as I thought I might be able to make it a function, but couldn't get it right;

     Table.AddColumn(#"1", "Custom", each
                                                      [Sales] /  List.Sum( Custom1{[Index=1]}[ALL] [Sales]), Percentage.Type)
    So I've like to get what i have for a single group, above, for each of the All Rows grouping,

    Richard.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Power Query - Feeding dynamic sheet name to Power query
    By egoosen3 in forum Excel General
    Replies: 5
    Last Post: 09-13-2023, 07:41 AM
  2. [SOLVED] Power query return total value of grouped columns
    By Dicken in forum Office 365
    Replies: 2
    Last Post: 06-20-2022, 05:30 AM
  3. Power Query Grouped Running Total
    By sle7en in forum Excel General
    Replies: 2
    Last Post: 02-13-2021, 06:30 PM
  4. [SOLVED] How to access data via VBA from a Connection Only Power Query query.
    By MLAN_75 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2020, 11:45 AM
  5. Replies: 4
    Last Post: 02-17-2020, 06:03 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. Replies: 2
    Last Post: 04-12-2018, 01:34 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