Closed Thread
Results 1 to 10 of 10

Requesting help for adding values in power query.

  1. #1
    Registered User
    Join Date
    02-22-2020
    Location
    St. Louis, MO
    MS-Off Ver
    Excel Version 365
    Posts
    29

    Requesting help for adding values in power query.

    I want to add values in a column together that are next to each other in the same column but It is for one invoice number that is in a different column. Any idea what formula I could use in power query?

  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,865

    Re: Requesting help for adding values in power query.

    Read the yellow banner at the top of this page. Also, please identify your Excel Version. ie. 2013, 2016, 365 etc.
    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
    Registered User
    Join Date
    02-22-2020
    Location
    St. Louis, MO
    MS-Off Ver
    Excel Version 365
    Posts
    29

    Re: Requesting help for adding values in power query.

    Sorry about that. I went ahead and updated it and I am attaching an example file.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-22-2020
    Location
    St. Louis, MO
    MS-Off Ver
    Excel Version 365
    Posts
    29

    Re: Requesting help for adding values in power query.

    In column A you will see what are supposed to be example Invoice Numbers. There are 1 to 2 lines for each number depending on what items they purchased in column G. You can also see the pricing for each item in column H and the totals for the amounts purchased in columns I.

    I need to get the totals for each each invoice, which basically is adding the totals of the items together, and put the grand invoice total in a separate column.

    I am trying to do this in power query so when I get a report each month I can just drop it into a folder(like I have been reading online) and have it do this automatically for the thousands of lines I get each month.

    Any help would be much appreciated!

  5. #5
    Registered User
    Join Date
    02-22-2020
    Location
    St. Louis, MO
    MS-Off Ver
    Excel Version 365
    Posts
    29

    Re: Requesting help for adding values in power query.

    I went ahead and added more to my example. I just read I was supposed to have some manually complete calculations.
    Attached Files Attached Files

  6. #6
    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,865

    Re: Requesting help for adding values in power query.

    v A B
    1 Column1 Total2
    2 769297 78.5
    3 772976 74
    4 772340 110
    5 772970 72.4
    6 776212 104
    7 775649 114
    8 776216 113
    9 772983 72.5
    10 776214 84
    11 772975 102.5
    12 776215 77
    13 762393 50.3
    14 776125 73.6
    15 774712 75.5
    16 773675 35
    17 776210 120
    18 775795 28
    19 773684 55
    20 773546 65
    21 776103 72
    22 776051 132.5
    23 775790 62
    24 773530 41
    25 776128 89
    26 771650 70
    27 771470 88
    28 771648 94
    29 771468 34
    30 772974 100
    31 776208 184
    32 776133 155
    33 771466 38.5
    34 772978 143.2
    35 776129 114

    Mcode below:

    Please Login or Register  to view this content.
    1. Bring Table into PQ
    2. Add Coluumn multiply quantity by price
    3. Group on Invoice number and total the new column

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Requesting help for adding values in power query.

    Open new file Open Power Query/Get and Transform. Click on New Query.
    Open blank query in the editor, launch Advanced Editor and paste in the following code.
    Change folder in Red

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    02-22-2020
    Location
    St. Louis, MO
    MS-Off Ver
    Excel Version 365
    Posts
    29

    Re: Requesting help for adding values in power query.

    Thank you for your reply. I do not think this is what I need. I am currently working with a pq and I am looking for a formula that would take the current information and add the to line totals together for a grand total and put it in a new column next to that data. Also, it has to display the grand total of the invoice on every line that has that invoice number. The invoice numbers are next to each other in column A. If you look at my second example I am adding together the green shaded numbers in column I, which would be the invoice total, then putting the invoice total under the total column but displaying the total on each line of that invoice. Same with the blue shaded numbers. If you look at the red shaded numbers, that invoice has only 1 line item so it would only display the invoice total once since it only has 1 line for that invoice.

    I know I am asking for a lot and I appreciate the help. I have never used pq but from what I have read once I change 1 report how I want it I can drop all future reports into that folder and hit refresh and it would run the new report through those changes I made. I can see how it saves the changes in the box on the right side of the screen in excel as I am completing them. If I am mistaken about this tool please let me know.

    Thank you!

  9. #9
    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,865

    Re: Requesting help for adding values in power query.

    Ok. A Power Query Update. I created the first table shown above and then created a new merged table joining the two tables (Your Original and my total) on the Invoice number. See the attached file for details and your analysis.
    Attached Files Attached Files

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Requesting help for adding values in power query.

    Thread closed pending a new, composite thread.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro for Power Query? (adding column)
    By elbrujo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-18-2019, 05:11 PM
  2. [SOLVED] Adding manual data to a power query?
    By S7ewie in forum Excel General
    Replies: 20
    Last Post: 01-19-2019, 08:44 AM
  3. 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
  4. Adding Column in Power Query
    By fuerte in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-28-2018, 12:39 PM
  5. Adding Column in Power Query
    By fuerte in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2018, 11:15 AM
  6. [SOLVED] Adding Missing Dates To A .CSV File Via Power Query?..
    By Ourkid123uk in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-04-2017, 03:54 PM
  7. Adding data to the end of a table with Power Query
    By afila in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-14-2016, 08:29 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