Exercise 3: Format your DAX

Task 1: Know Your Shortcuts
This exercise helps you understand the shortcuts available in the DAX editor. It is seemingly a
very basic text area with not a lot of powerful formatting tools however these shortcuts are
bound to make your life better every time you work with Measures.
Create a new measure to run through the subsequent tasks.
Task 2: Insert a new line below

To using Shift+ enter key you can move to the new line of code or you can say add new line
below. Note Alt+ enter also works the same

1 – Insert a new line below : (Shift+ enter)

Task 2: Insert a new line above

2- Insert line above : (Ctrl + Shift + Enter)

Using Ctrl + Shift + Enter you can add one new line just above your current line.
Task 3: Select the current line

3- Select current line- (Ctrl + i)

Using this you can select current line, click on line which you want to select then press Ctrl +
I.
Task 4: Comment a line

4- Comment a line – (Ctrl + K + C)

You can comment multiline DAX code to using these keys, select lines which you want to
comment then press Ctrl + K+ C together.
Task 5: Uncomment a line

5- Uncomment a line – (Ctrl + K + U)

To uncomment multilines of DAX code you can use Ctrl + K + U.

Task 11: Delete a full line of code

11- Deleting a full line of code – (Ctrl + Shift + K)

Keep cursor anywhere in that line which you want to delete fully and press Ctrl + Shift + K.
Task 12: go to Start and End line

12- Go to the Start and End line of code – (Ctrl + Home ) and (Ctrl + End)

Ctrl + Home : Point cursor start of the Code
Ctrl + End : Point cursor end of the Code
Task 13: go to daxformatter and try a fast approach

13- Go to https://www.daxformatter.com/raw/ and try copying and pasting an unformatted

measure. Format it in daxformatter then copy it back into your Measure area in Power BI
Desktop.
Task 14: Access the helper with Shift + ?
When using Power BI Desktop, you can press Shift + ? to show keyboard shortcuts.
Task 15: Try a shortcut in another part of Power BI Desktop
Click on a visual, format it as a chart, then press Enter to see what happens. Press Enter
multiple times. Press Esc. Click Shift + Right arrow. Click Ctrl + H.
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-accessibility-keyboardshortcuts