Power BI – DAX

What is DAX?

DAX stands for Data Analysis eXpressions and is the language behind Power BI. DAX is a formula expression language used in Analysis Services, Power BI, and Power Pivot in Excel.

With the help of DAX, analysts discover ways to analyze data and come up with great ideas and insights

For e.g.

  • As DAX is a functional language meaning its complete codes are functions. DAX may contain conditionals statements and nested functions and references.
  • There are two primary data types, i.e. Numeric and Nonnumeric.
  • Expression in DAX are always evaluated from the inner-most function to the outer-most functions, its executions go outwards.

DAX in Power BI

Data importing and visualization in Power BI is a smooth experience and you can create powerful and advanced reports using Power BI leveraging the functionalities it provides. But, if you want to level up the advanced calculations. Though Power BI is a powerful tool but DAX with its functionalities can help you level up.

Let’s say, for example, you want to visualize the growth of your company for the first quarter of 2020 and want to analyze the growth for the next quarter you need to make new measures using DAX language. In this way, you can create new measures, use them for creating exclusive visualizations, and have unique insights into data. With such unique insights into data, you can have fitting solutions for the business problems that you might miss with the usual way of analysis. Thus, DAX makes data analysis using Power BI, a smart and intelligent approach.

Queries

DAX queries can be created and run in SQL Server Management Studio (SSMS) and open-source tools like DAX Studio (daxstudio.org). Unlike DAX calculation formulas, which can only be created in tabular data models, DAX queries can also be run against Analysis Services Multidimensional models. DAX queries are often easier to write and more efficient than Multidimensional Data Expressions (MDX) queries.

A DAX query is a statement, similar to a SELECT statement in T-SQL. The most basic type of DAX query is an evaluate statement. For example,

EVALUATE
 ( FILTER ( 'DimProduct', [SafetyStockLevel] < 200 ) )
ORDER BY [EnglishProductName] ASC

Returns in Results a table listing only those products with a SafetyStockLevel less than 200, in ascending order by EnglishProductName.

Conclusion

With this, we conclude basic use cases of DAX in Power BI. You can create any logically sound DAX formula by using the existing columns and tables in your Power BI to make more detailed and advanced reports.

Share your feedback through comments.