Introduction to Data Analysis

  • Read
  • Discuss

DAX (Data Analysis Expressions) is a formula expression language that may be utilised in a variety of business intelligence and visualisation tools. DAX is also known as function language because the entire code is contained within a function. There are two data kinds in DAX programming formulas: numeric and other. Numeric data types include integers, money, and decimals, while Other data types include string and binary objects.

DAX Functions

You can use several function types in Power BI to analyze data and generate new columns and metrics. It includes functions from various categories, like:

  • Aggregate
  • Text
  • Date
  • Logical
  • Counting
  • Information

Importance of DAX Functions

It’s simple to start a new Power BI Desktop file and import data into it. You can even construct reports that provide useful insights without using any DAX formulae. But what if you need to compare growth rates across product categories and time periods? Or do you need to compare year-over-year growth to market trends? This functionality, as well as many others, is provided by DAX formulas. Learning how to construct efficient DAX formulae can assist you in making the most of your data. When you have the necessary knowledge, you may begin to solve real-world business problems that influence your bottom line.

How to write a DAX Formula?

DAX formulas are simple to understand and read. This makes it simple to grasp the fundamentals of DAX, allowing you to begin building your own formulas immediately. Let’s go over the fundamentals of proper DAX syntax.

Figure 1: How to write a DAX Formula in Power BI
  1. The measure or calculated column’s name
  2. The equal-to operator (“=”) denotes the beginning of the formula.
  3. DAX functions
  4. Parentheses (“()”) are opened and closed.
  5. References to columns and/or tables
  6. Each following parameter in a function is denoted by a comma (“,”).

To conduct many tasks efficiently, DAX functions can be nested inside each other. This can save a significant amount of time when writing DAX formulas. For example, having many nested IF statements or using the IFERROR function to wrap around another function such that any errors in the formula are represented by the value you provide is often useful.

The following are some of the most common DAX functions found in reports:

  • Simple arithmetic: COUNT, DISTINCTCOUNT, SUM, AVERAGE, MIN, MAX are all functions.
  • SUMMARISE: Returns a table that is generally used to apply further aggregations across different groupings.
  • CALCULATE: Aggregates the results of one or more filters. When more than one filter is specified, the function will execute the calculation where all filters are true.
  • IF: A logical condition is met, it will return a different value depending on whether it is true or false. This is identical to the SQL CASE WHEN operation.
  • IFERROR: Searches for errors in an inner function and returns the specified result.
  • ISBLANK: Determines whether or not the rows in a column are blank and returns true or false. Useful in conjunction with other functions such as IF. 
  • EOMONTH: Returns the final day of the month of a specified date (column reference in a date format) for as many months in the past or future as there are months in the past or future.
  • DATEDIFF: returns the difference in days, months, quarters, years, and so on between two dates (both as column references in date formats).

Leave a Reply

Leave a Reply

Scroll to Top