M Code Anxiety - hard coded row/column references as variables

GooberTron

Board Regular
Joined
Oct 13, 2012
Messages
218
I've just about progressed beyond the main Power Query interface, and getting a better grip of simple M Code.
Most of my transformation needs can be sorted out using various Unpivot, Pivot, Transpose, Fill Down type things. I've happily worked through "Master Your Data..." v2 and it's been really helpful.
There are, however, a few jobs where I'm now resorting to grabbing specific column/row values as variables in order to shuffle things around and create new columns with this metadata copied down.
I mean, it works (providing nothing changes in the report layouts), but I can't help feeling it's a bit unsophisticated and reminds me of how I might have done this in VBA (though there I would use search functions and offset row / columns to find metadata in workbooks).
Anyone got any wise words or learning resources for me? At the moment, the only alternative I can see would be to have multiple queries of the same table and append or join things together later - but holding a few things as hard coded variables keeps everything in the same query.

Thanks
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,223,327
Messages
6,171,481
Members
452,407
Latest member
Broken Calculator

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top