Chapter 20: Understanding the M Language

Joined
Jun 26, 2017
Messages
25
Reaction score
0
Points
0
Excel Version(s)
2016
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 :)
 
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.
 
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.

HTH,
 
Back
Top