DAX Query view

When making reports, users often create measures using complex DAX expressions. Because of this, they often use some external tools to prepare and analyze the created measures. For this reason, the Power BI development team added, in addition to the three existing ones, one more view within the Power BI Desktop application. It enables the creation and analysis of complex DAX measures.

To be able to access the DAX Query view, it must first be enabled. This is done in the Power BI Desktop settings, by selecting the appropriate option in the Preview Features section.

When you enter the DAX Query view on its upper side, you will see a space for writing DAX statements. When we write a DAX statement, after the EVALUATE function, and then click the Run button, in the space at the bottom of the window you will see a table with the results it returns. This is very similar to the Query editor in SQL Server Management Studio.

For example, if we write the statement:

EVALUATE
FILTER (Items,Items[CLASSIFICATION]=”CHOCOLATE”)

we will get a table with all the values of the table of items that belong to the “chocolate” classification. We can copy this DAX statement, and use it to create a measure or calculated column.

Within the DAX Query view, we can additionally format the DAX query, add or remove comments, manage the display of DAX statements…