Remember my post about DAX formula bar keyboard shortcuts in Power BI Desktop? Turns out, there are also lots of keyboard shortcuts in Advanced Editor inside Power Query Editor in Power BI, with many being the same as in DAX formula bar!
First, I need to point out that for most of these keyboard shortcuts to work, you need to have M IntelliSense enabled — as of December 2018, it is a preview feature.
To do so, click File > Options and settings > Options > Preview features > M IntelliSense:
Second, you might notice that my GIFs below have something on the right side of Advanced Editor: mini map. Added in December 2018, this feature displays a bird’s-eye view of your code. To add it, click Display Options > Display mini map:
You can comment out/uncomment one or more lines of code by pressing Ctrl + / or Alt + Shift + A.
- Ctrl + / creates single-line comments
- Alt + Shift + A creates a single block comment
You can increase the indentation by pressing Tab or Ctrl + ]. To decrease the indentation, press Shift + Tab or Ctrl + [.
You can type in multiple places at once by holding Alt + Click.
Go to line
In case you have many lines of code, you can go to a specific line number by pressing Ctrl + G and typing the line number, then pressing Enter.
Remove whole lines
You can remove whole lines, even if they are selected partially, by pressing Ctrl + Shift + K.
Trigger parameter hints
If you forgot the syntax of a function, you can press Ctrl + Shift + Space.