A short blog post, but one that can save you a lot of time.
Shortcut 1: Add/delete comments
Did you know that you can put text in a comment (or delete the comment) by selecting one or more lines, and then clicking CTRL+/ ?
Select the lines you want to insert in comment.
The selected text is inserted in comment.
PS: You can also use the shortcuts CTRL+K+C and CTRL+K+U, but you will then have to learn two different shortcuts.
Shortcut 2: Changing values
In the following code, suppose you want to change the name of (and the references to) the variable _PY to __NrOfOrdersPY.
Most people will change all instances one by one. But you can also do this all at once:
Click on the variable you want to rename.
Click on CTRL+F2
Now you can change each instance of that variable at the same time. In the example below, you are now changing the text in 3 places at the same time. And this doesn’t only apply to variables; you can also apply it to the names of columns, tables and even functions.
Another shortcut that I often use is CTRL+SHIFT+ENTER. This shortcut key will add an extra blank line to the previous line. (So you won’t need to go to the beginning of the current line and press SHIFT+ENTER first)
The complete list
These are the keyboard shortcuts that I like and use often. If you are a fan of keyboard shortcuts, take a look at the full list on Microsoft’s site:
Or subscribe to our Power BI day on Tuesday 25 october 2022 !