How to add subtotal in a row in Power Query

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 พ.ย. 2024

ความคิดเห็น • 19

  • @wayneedmondson1065
    @wayneedmondson1065 2 ปีที่แล้ว +1

    Cool use of the #table function. You are very creative! Thanks for sharing. Thumbs up!!

  • @ssmith8717
    @ssmith8717 ปีที่แล้ว

    Great tutorial!

  • @jazzista1967
    @jazzista1967 2 ปีที่แล้ว +2

    Is it possible to add a Grand TOTAL for items A, B & C? I am dealing with something like this at work. Great example .Thanks

    • @SoNonWoo
      @SoNonWoo 2 ปีที่แล้ว

      I think that you'd need to make another table, sum the entire list, and combine it just as shown

    • @jazzista1967
      @jazzista1967 2 ปีที่แล้ว

      @@SoNonWoo Thanks I will try that

  • @alterchannel2501
    @alterchannel2501 ปีที่แล้ว +1

    very useful trick. I wished you commented the video instead of the music (it's a personal thing, music distracts me, music and coding take up the same space of my brain, the creation part 🤣🤣🤣🤣)

  • @markmcpartland3885
    @markmcpartland3885 ปีที่แล้ว

    Thanks for your video. Was the only place could find answer to this.
    One thing I'm trying to do extra though is put the group totals as Header rows above the detail, rather than below. Cant work it out. Is it possible?

    • @short_excel
      @short_excel  ปีที่แล้ว +1

      Based on the attachment used in the video, please make the following changes to the code.
      = Table.Group(#"Changed Type", {"Column1"}, {{"tbl", each #table(Table.ColumnNames(_),{{[Column1]{0} &" Total", List.Sum([Column2]) }} ) & _ }} )

    • @markmcpartland3885
      @markmcpartland3885 ปีที่แล้ว

      @@short_excel Works Great. Simple . Thanks for taking time to respond

  • @yaminkerkoub7829
    @yaminkerkoub7829 ปีที่แล้ว

    Hello, thank for sharing your expertise.
    I want to do exactly the same, but with more columns (suppose 4), but the subtotals remains only one or two columns. How can I add the columns after COL 1 before COL 2 ? Thanks

    • @markmcpartland3885
      @markmcpartland3885 ปีที่แล้ว

      You just need to ensure this section has the same number of columns as your main table:
      each _ & #table(Table.ColumnNames(_),{{"","",[GroupID]{0},[Group title]{0},List.Sum([Total Hours]) }} ) }})
      I added two extra columns with blanks at the front before my GroupID.
      Similar Q&A a few weeks before as well below

  • @sumardjo
    @sumardjo 2 ปีที่แล้ว

    Thanks for knowledge and sample file
    very nice
    Thanks you very much

  • @rrrraaaacccc80
    @rrrraaaacccc80 11 หลายเดือนก่อน

    Excellent 💯👍

  • @smartwork4768
    @smartwork4768 2 ปีที่แล้ว

    Awesome trick

  • @atiqurrahman1962
    @atiqurrahman1962 2 ปีที่แล้ว

    Very useful 👌. But sir how can I get total from several columns? Please help me. Thanks a lot.

    • @SoNonWoo
      @SoNonWoo 2 ปีที่แล้ว

      he used the List.sum on column B. Just use list.sum for each column you want to sum.

  • @Luciano_mp
    @Luciano_mp 2 ปีที่แล้ว

    Good..Thanks!

  • @faell23
    @faell23 ปีที่แล้ว

    How to create with 3 columns, the first column being dates and the subtotal being applied in the 3rd column? I need to process a bank statement.
    Example
    01/07/2023 | PIX | 20,00
    01/07/2023 | Maestro | 40,00
    01/07/2023 |Visa | 40,00
    --------------------|SUBTOTAL | 100

    • @short_excel
      @short_excel  ปีที่แล้ว +1

      let
      Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
      #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type date}, {"Column2", type text}, {"Column3", Int64.Type}}),
      Result = Table.InsertRows(#"Changed Type",Table.RowCount(#"Changed Type"),{[Column1="-------------------",Column2="SUBTOTAL",Column3 = List.Sum(#"Changed Type"[Column3])]})
      in
      Result