+ Reply to Thread
Results 1 to 8 of 8

Calculation in Power Query

  1. #1
    Registered User
    Join Date
    12-02-2016
    Location
    Stockholm
    MS-Off Ver
    2019
    Posts
    27

    Calculation in Power Query

    Hi all,

    In my work I frequently work with large lists and need to verify data. Now, I've just started using Power Query to perform most of the simple, repetetive tasks. Now, I have a calculation that I do in PQ and I have kind of a solution for it but I want to have your expert opinion on how it should be done.
    At the moment I calculate the steps individually in several columns using If-functions and then sum it up to get the result - It's not pretty.


    What I want is to introduce 1 custom column that calculates the price per shipment the customer owes. Perhaps there is also a way of adapting to changes in prices etc. without having to resort to changing M code for the specific column?

    Basically it's like this: The number of pallets x the price for the particular zone (zone is based on city) + added cost according to Rtype and RCustomercategory (Only HHH has a price)

    How could this be done in a efficient way? I feel like I'm using an axe to dig with or something....


    Any help on this would be greatly appreciated.


    Best regards

    Frej
    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 (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Calculation in Power Query

    No sign of a query in the sample workbook - please share what you have already constructed.

    You cannot be using Excel 2010 any longer, so please update your forum profile. Thanks.
    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.

  3. #3
    Registered User
    Join Date
    12-02-2016
    Location
    Stockholm
    MS-Off Ver
    2019
    Posts
    27

    Re: Calculation in Power Query

    Hi Ali,

    Correct there is no sign of a query in the example as I'm not looking for corrections on what I've already done, I'm looking for an example of what someone with real skills would have done with the problem I presented.
    To make sure I'm not misrepresenting I've also updated my profile to reflect the current version.

  4. #4
    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,916

    Re: Calculation in Power Query

    OK - but we are going to need mocked up results at the very least - 10-20 rows.

    It would be EASIER to advise you if you shared your attempt. Without any knowledge of how you've gone about it, it's impossible to correct misapprehensions or to present an optimum solution.

    Up to you. I'll wait and see if the information I've requested is forthcoming.

  5. #5
    Registered User
    Join Date
    12-02-2016
    Location
    Stockholm
    MS-Off Ver
    2019
    Posts
    27

    Re: Calculation in Power Query

    I agree, it would be easier to have you critique my code and suggest options by attaching my code etc. - that is NOT what I'm asking for. I would like someone with more experience of M code to give me a suggestion on how to resolve the problem I've presented. In a way that is more in line with "how things are done" in the "real" world of M code. Perhaps my descriptive powers or cognitive abilities are lacking here, but that was my mission. If that does not work in this forum, please tell me and I'll close my questions.

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

    Re: Calculation in Power Query

    OK, if you insist - hopefully someone else has the time to build a solution for you. Sorry, but I don't have that sort of time free today.
    Last edited by AliGW; 04-02-2021 at 08:25 AM.

  7. #7
    Registered User
    Join Date
    12-02-2016
    Location
    Stockholm
    MS-Off Ver
    2019
    Posts
    27

    Re: Calculation in Power Query

    I see the error of my ways. I'll close this thread. Perhaps you as an admin can delete it? It adds zero value to the community in my eyes at least.

  8. #8
    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,916

    Re: Calculation in Power Query

    There is no need to do that - you will just need to wait for someone who has the time to do this in the way you have asked. There are plenty of others, but most are in different time zones, so you will need to be patient.

    I would have gladly had a look if you'd shared your attempt, but I just don't have time for anything more at present.

+ 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/Power Pivot Conditional Column creation & chart
    By mz_h in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-12-2020, 06:07 PM
  2. [SOLVED] 2 fields checker- Request for alternative option in Power Query or Power Pivot
    By Shareez Saleem in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-15-2020, 08:36 AM
  3. [SOLVED] Power Query column word occurrence calculation performance
    By Imbizile in forum Excel General
    Replies: 5
    Last Post: 10-18-2020, 07:31 AM
  4. Replies: 10
    Last Post: 06-25-2020, 12:19 AM
  5. [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
  6. Replies: 4
    Last Post: 02-17-2020, 06:03 AM
  7. 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

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