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 fly through the Power Query Advanced Editor with keyboard shortcuts!

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 ShortcutAction
Ctrl + Shift + +Increase font size.
Ctrl + Shift + Decrease font size.
Ctrl + 0Restore original font size.
Ctrl + MToggles tab behavior ON or OFF.
Ctrl + Tab, EnterSave and close Advanced Editor.
Alt + F4Close 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 the last three let you jump to a previous line or a next or previous highlighted word.

Keyboard Shortcuts for Quick Editing

Keyboard ShortcutAction
Ctrl + Scroll up a code line.
Ctrl + Scroll down a code line.
Alt + Page UpShift selection up one page.
Alt + Page DownShift selection down one page.
Ctrl + UReturn to previously selected line.
F7Navigate to next highlighted word.
Shift + F7Navigate 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 ShortcutAction
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 ShortcutAction
TabIndent / Add 3 spaces after cursor position.
Ctrl + [Indent / Add 3 spaces at the start of the current line.
Shift + TabOutdent / 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 ShortcutAction
Shift + HomeHighlight to start of current line.
Shift + End Highlight to end of current line.
Shift + Page UpHighlight up to the start of the query.
Shift + Page DownHighlight 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 ShortcutAction
Ctrl + Shift + KDelete 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 ShortcutAction
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 + ClickManually choose multiple cursors or highlight multiple words for simultaneous editing.
Ctrl + ZUndo change.
Ctrl + YRedo 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!

Share on:

Latest from my blog

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

        Reply

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.