Results 1 to 3 of 3

Thread: Chapter 20: Understanding the M Language

  1. #1
    Acolyte Iloveexcel&excelloveme's Avatar
    Join Date
    Jun 2017
    Excel Version

    Chapter 20: Understanding the M Language

    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi All,

    Forgive my lack of understanding on this Chapter on "Combining Power Query Steps" but when would it be good to combine steps beside the mentioned "Table SelectRows", in the example?

    And what the benefit beside having a clearer codes?

    Have a good day all

  2. #2
    Seeker MushroomFace's Avatar
    Join Date
    Jun 2018
    Excel Version
    I presume in M, where you usually quote the name of the last step, they've replaced that by actually inputting the formula that would have been shown, therefore consolidating it. I'd just test it out on a few lines (I.e more than two, it seems the 'even' step takes lead and the 'odd' step would go into prior step) but then again I've only just discovered this forum! Woo, no more self teaching.

  3. #3
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Nanaimo, BC, Canada
    Blog Entries
    Excel Version
    Excel Office 365 Insider
    To be honest, I don't think this actually makes clearer code, I think it does the opposite. By having the steps broken down, you can see what was happening step by step through the Applied Steps window. By combining them, you have to read the code, which is harder to do.

    Where this becomes important is when you have operations that MUST be combined in order to work properly. Let's say for example that you want to add a new Index column to each sub-table contained in a column, and maybe unpivot those sub tables before you expand them. At that point you need to figure out how to add the Index column, how to unpivot, and then add those commands together into one step to use in a custom function.

    While the book tries to illustrate this in an easy to understand matter, I would only use this technique if I absolutely have to in order to make something work the way I need.

    Ken Puls, FCPA, FCMA, MS MVP

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book M is for Data Monkey, or our new Power Query Recipe cards!

    Main Site: -||- Blog: -||- Forums:
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts