+ Reply to Thread
Results 1 to 8 of 8

Convert Formula to Power Query

  1. #1
    Registered User
    Join Date
    02-28-2019
    Location
    Peterborough
    MS-Off Ver
    2013
    Posts
    94

    Convert Formula to Power Query

    Hi All,

    I'm looking for some help converting an excel formula im using (that works perfectly fine) to a Power query formula. I have decided a power query will better suit my data outcome so want to move across but obviously the language is different and I cant work out how to convert it. here is my normal excel formula:

    Please Login or Register  to view this content.
    Its a nice simple IF statement that includes a LEFT function.

    Hope someone can help convert it into a power query formula.

    Thanks in advance,

  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
    81,122

    Re: Convert Formula to Power Query

    Nested If/Then: https://community.powerbi.com/t5/Des...540348#M253724

    LEFT function replicated: https://www.myexcelonline.com/blog/r...n-power-query/

    If you attach a workbook, one of us might be prepared to help you with the exact formula.
    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
    02-28-2019
    Location
    Peterborough
    MS-Off Ver
    2013
    Posts
    94

    Re: Convert Formula to Power Query

    Hi Thanks for the reply. I have attached a data file that has the extra column added to the table showing how I would need the query to respond. But I do need the column adding in powerquery not in the direct table on excel.

    thanks for any help anyone can provide.
    Attached Files Attached Files

  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
    81,122

    Re: Convert Formula to Power Query

    Who said anything about not doing it in PowerQuery?

    Both of the links lead to information related to setting this up in PowerQuery.

  5. #5
    Registered User
    Join Date
    02-28-2019
    Location
    Peterborough
    MS-Off Ver
    2013
    Posts
    94

    Re: Convert Formula to Power Query

    When I said I need it in PowerQuery not in excel I meant because in my data set I attached I added it to the original table in excel to show the example and didn't want there to be any confusion with what I meant

  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
    81,122

    Re: Convert Formula to Power Query

    OK - so what was it about the tutorials I provided that left you unable to create the formula in PQ?

  7. #7
    Registered User
    Join Date
    02-28-2019
    Location
    Peterborough
    MS-Off Ver
    2013
    Posts
    94

    Re: Convert Formula to Power Query

    Nothing about your tutorials left me unable. in fact they were extremely helpful, I was able to create the following formula which works perfectly well.

    Please Login or Register  to view this content.
    I wasn't looking for someone to create it for me, I much prefer if I am able to get support in writing it myself as it teaches me something along the way
    I had previously come across the LEFT function page but wasn't able to understand where to insert it, however the Nested IF page you provided is what explained the most part to work out the structure of how I needed to write it, so I'm over the moon

    So, thank you for providing your support and links

  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
    81,122

    Re: Convert Formula to Power Query

    Brilliant - well done!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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 Pivot/Query Convert Existing Table to Query
    By trisoldee in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-23-2019, 04:27 PM
  2. How to resolve Data FormatError We couldn't convert it to Number-Power Query
    By paradise2sr in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-25-2019, 01:16 AM
  3. [SOLVED] Power Pivot does not load new column added in Power query
    By ibuhary in forum Excel General
    Replies: 12
    Last Post: 02-19-2019, 03:53 AM
  4. 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
  5. Replies: 0
    Last Post: 04-05-2018, 01:16 AM
  6. Power Query convert Unix time to a date
    By logisteve in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2015, 06:25 PM
  7. Macro to convert Power Query Worksheet to standard workbook
    By Brawnystaff in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2015, 01:34 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