In this article, you will learn the Advanced Editor keyboard shortcuts in Power Query that will help you improve your productivity. You’ll learn shortcuts to navigate through your data, move and select text, duplicate rows, and perform other editing tasks efficiently. These shortcuts will save you time and make you more efficient when working with Power Query.
Table of contents
General Keyboard Shortcuts
General
The first section focuses on general shortcuts to improve your workflow. To make reading your code easier, you can change the font size. Or, in other cases, you may want to toggle off the indenting behaviour of the TAB key. It can all be done.
And when you’re done editing, you can close the advanced editor with your keyboard. You can do all that with the below keystrokes.
Keyboard Shortcut | Action |
---|---|
Ctrl + Shift + + | Increase font size. |
Ctrl + Shift + – | Decrease font size. |
Ctrl + 0 | Restore original font size. |
Ctrl + M | Toggles tab behavior ON or OFF. |
Ctrl + Tab, Enter | Save and close Advanced Editor. |
Alt + F4 | Close Advanced Editor (without saving). |
Navigation
Moving around your code quickly can add up in time savings.
The first 4 keyboard shortcuts below move your screen up or down, whereas the last three let you jump to a previous line or a next or previous highlighted word.
Keyboard Shortcuts for Quick Editing
Keyboard Shortcut | Action |
---|---|
Ctrl + ↑ | Scroll up a code line. |
Ctrl + ↓ | Scroll down a code line. |
Alt + Page Up | Shift selection up one page. |
Alt + Page Down | Shift selection down one page. |
Ctrl + U | Return to previously selected line. |
F7 | Navigate to next highlighted word. |
Shift + F7 | Navigate to previous highlighted word. |
We move on to keyboard shortcuts that focus more on editing code.
Commenting
It’s good practice to document your code. Others may take over your model, or perhaps you want to comment out certain logic temporarily. Either way, you can use the below shortcuts to address this quickly.
The shortcuts add a single-line comment by prefixing lines with //. The multi-line commenting works by prefixing the first line with /* and the last line with */.
Keyboard Shortcut | Action |
---|---|
Ctrl + / | (Un)comment single line comments, uses //. |
Alt + Shift + A | (Un)comment multi line comments, uses /* …. */. |
Moving
While writing in the advanced editor, you sometimes need to move around the code. This purpose can be aesthetic (indentation, line breaks, etc.), or perhaps you require some steps to perform earlier or later in your logic. Below shortcuts are there to help:
Keyboard Shortcut | Action |
---|---|
Tab | Indent / Add 3 spaces after cursor position. |
Ctrl + [ | Indent / Add 3 spaces at the start of the current line. |
Shift + Tab | Outdent / Remove 3 spaces at start of the current line. |
Ctrl + ] | Outdent / Remove 3 spaces at start of the current line. |
Alt + ↑ | Move current line of code up one line. |
Alt + ↓ | Move current line of code down one line. |
Selecting
When you need to remove or replace code, the shortcuts below help you highlight all code up till the beginning or end of the current line or the query itself.
Keyboard Shortcut | Action |
---|---|
Shift + Home | Highlight to start of current line. |
Shift + End | Highlight to end of current line. |
Shift + Page Up | Highlight up to the start of the query. |
Shift + Page Down | Highlight up to the end of the query. |
Duplicate or Delete
There are three shortcuts that help in duplicating existing lines of code or deleting lines:
Keyboard Shortcut | Action |
---|---|
Ctrl + Shift + K | Delete selected line(s) of code. |
Shift + Alt + ↑ | Duplicate current line(s) of code. |
Shift + Alt + ↓ | Duplicate current line(s) of code. |
Efficient Editing
To get efficient in your editing, you can use some tricks. Instead of writing out all parentheses, Curly Brackets or Double Quote, you can select characters and use a shortcut.
At other times, you can use a shortcut to edit multiple lines of code at the same time. Incorporate both in your workflow, and you can see the difference.
And when you make a mistake, you can always undo or redo changes.
Keyboard Shortcut | Action |
---|---|
Shift + “, Space | Enclose selection in Double Quotes. |
Shift + ( | Enclose selection in Parenthesis. |
Shift + { | Enclose selection in Curly Brackets. |
Ctrl + Alt + Shift + ↑ | Copy cursor to line above for multi-line editing. |
Ctrl + Alt + Shift + ↓ | Copy cursor to line below for multi-line editing. |
Alt + Click | Manually choose multiple cursors or highlight multiple words for simultaneous editing. |
Ctrl + Z | Undo change. |
Ctrl + Y | Redo change. |
Summary
In conclusion, using keyboard shortcuts in Power Query advanced editor can be a game changer for your productivity. If you can’t get enough of them, this article delves into the best keyboard shortcuts for Power Query.
The shortcuts that we covered in this article are designed to help you navigate through your data, move and select text, duplicate rows, and perform other editing tasks efficiently.
By using these shortcuts, you can save time, work more efficiently and perform tasks more accurately. It’s a great way to become more proficient with the Advanced Editor.
I hope you found this article helpful and that you are now ready to use the keyboard shortcuts in your work with Power Query Advanced Editor.
Enjoy Power Query!
Recommended Reading…
Power Query Foundations
Beginners Guide to Power Query
List Functions (200+ Examples)
Text Functions (150+ Examples)
Creating Tables (40+ Examples)
Generate the Ultimate Date Table
Advanced Topics
Master List.Generate with Easy Examples
Deep Dive into List.Accumulate
Hey Rick,
thanks for your super list! I have a question:
Is there a shortcut for replacing all highlighted values?
Thanks from Germany!
At the moment there’s not. In Q1 2023 it is expected that Power Query gets the new experience. Perhaps at that point the shortcut gets introduced to. Let’s hope so!
Hey Rick,
thanks for this super helpful list of shortcuts!
Just fyi, for the adding curley brackets shortcut, I think there’s a typo
Thank you very much Abraham. I’ve corrected it right away. The shortcut is:
Under Navigation, F7 moves to the next highlighted word in the Formula Bar. Is there a way to select all highlighted words, so they can be replaced at once?
Brad – I’m afraid there’s no such shortcut at this point. It’s something I’ve really wanted. If you find out a way to do it, please report back. I’d love to know how!
My workaround:
Copy all code to Sublime Text | Double-click what you want to replace | Alt+F3 | Type your replacement | Select all and copy | Replace all code in the PQ editor.