Written By Rick de Groot

Rick is the founder of BI Gorilla. He believes learning is one of life's greatest pleasures and shares his knowledge to help you improve your skills.

Are you tired of clicking through menus and wasting time while working in the Power Query Advanced Editor? Then this article is for you.

In this article, we’re gonna show you all the Advanced Editor keyboard shortcuts you need to improve your productivity and work like a pro. 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.

In this article I share the most useful keyboard shortcuts that will improve your M-coding workflow. So, let’s get started and learn how to use Power Query Advanced Editor like a boss with keyboard shortcuts!

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 behavior 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 below key strokes.

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).

Moving around your code quickly can add up in time savings.

The first 4 keyboard shortcuts below move your screen up or down, whereas as the last three let you jump to a previous line or a next or previous highlighted word.

Ctrl + ⬆️       // Scroll up 1 line of code.
Ctrl + ⬇️       // Scroll down 1 line of code.
Alt + Page Up   // Move selection one page up.
Alt + Page Down // Move selection one page down.
Ctrl + U        // Go to previously selected line
F7              // Go to next highlighted word.
Shift + F7      // Go to previous highlighted word.

Keyboard Shortcuts for Quick Editing

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 temporarily comment out certain logic. Either way, you can use below shortcuts to quickly address this.

The shortcuts add a single line comment to by prefixing lines with //. The multi-line commenting works by prefixing the first line with /* and the last line with */.

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:

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 the start of the current line.
Ctrl + ]    // Outdent / Remove 3 spaces at the 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 below shortcuts help you in highlighting all code up till the beginning or ending of the current line or the query itself.

Shift + Home      // Highlight text up to the start of the current line.
Shift + End       // Highlight text up to the end of the current line.
Shift + Page Up   // Highlight text up to the start of the query.
Shift + Page Down // Highlight text up to the end of the query.

Duplicate or Delete

There are three shortcuts that help in duplicating exist lines of code or deleting lines:

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 Parenthesis, Curly Brackets or Double Quote, you can select characters and use a shortcut.

And 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.

Shift + ", Space          // Surround highlighted characters with Double Quotes.
Shift + (                 // Surround highlighted characters with Parenthesis.
Shift + {                 // Surround highlighted characters with Curly Brackets.
Ctrl + Alt + Shift + ⬆️  /* Make multiline selection with line above 
                           for editing multiple lines simultaneously. */
Ctrl + Alt + Shift + ⬇️  /* Make multiline selection with line below 
                            for editing multiple lines simultaneously. */
Alt + Click   /* Manually select multiple cursor positions or 
              manually highlight multiple words for editing at the same time. */
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. 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.

Did I miss any shortcuts that you feel are worth adding? Let me know and I can add them to the list.

Enjoy Power Query!

Share on:
  1. Hey Rick,

    thanks for your super list! I have a question:
    Is there a shortcut for replacing all highlighted values?

    Thanks from Germany!

    Reply
    • 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!

      Reply
  2. Hey Rick,
    thanks for this super helpful list of shortcuts!
    Just fyi, for the adding curley brackets shortcut, I think there’s a typo

    Reply
  3. 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?

    Reply
    • 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!

      Reply

Leave a comment