Learning about shortcuts is an integral part of mastering any program, and they come naturally as users get accustomed to using them. If you’re a regular reader of our blog, you might have noticed that Microsoft Power BI is one of the most popular programs at DevScope. We have a consultancy, and a development team specialized in Power BI, so Data Analysis Expressions (DAX) is used quite frequently around these parts.
We asked many members of our team for their favorite DAX shortcut when writing it in Power BI Desktop, and listed them here to help you boost your productivity:
The basics:
Go to line…: Ctrl + G
Select an entire line: Ctrl + I, regardless of where the cursor is
Undo the last cursor operation: Ctrl + U
Cut a line (empty selection): Ctrl + X
Insert a new line above: Ctrl + Shift + Enter
Jump to a matching bracket: Ctrl + Shift + \
Go to the start of your code: Ctrl + Home
Go to the end of your code: Ctrl + End
The intermediate:
Scroll line up or down: Ctrl + Up Arrow key or Ctrl + Down Arrow key
Indent right: Ctrl + ]
Indent left: Ctrl + [
Insert a new line, keeping indentation: Shift + Enter
Insert a new line, starting at the beginning: Alt + Enter
Activate IntelliSense: Ctrl + Space
Move the current line up or down: Alt + Up Arrow Key or Alt + Down Arrow Key
The advanced moves:
Comment multiple lines: Alt + Shift + A, Ctrl + KC or Ctrl + /
Uncomment multiple lines: Ctrl + KU or Ctrl + /
Toggle Tab Move Focus: Ctrl + M
Remove lines: highlight the lines you wish to remove and press Ctrl + Shift + K
Find and replace some instances of a word: firstly, use Ctrl + D to highlight the current word, then keep pressing Ctrl + D to find and highlight each instance of that word. Once highlighted all instances you wish to replace, start typing to replace all at once.
Find and replace all instances of a word at once: firstly, press Ctrl + Shift + L to highlight all instances of a word/selection, then start typing to replace all at once.
Copy a line: instead of Ctrl + C and Ctrl + V, you can copy the currently selected line to the one above or below it by either pressing Alt + Shift + Up Arrow Key or Alt + Shift + Down Arrow Key.
Expand selection: press Alt + Shift + Right Arrow Key to select the nearest word. Do it successively to expand the selection.
Shrink selection: press Alt + Shift + Left Arrow Key successively to shrink the selection.
We hope some of this can be helpful to you when writing DAX. Let us know if we overlooked a useful DAX shortcut so we can add them to the list and pass them on to our team.