How to use CALCULATE in DAX?

CALCULATE IN DAX

This article shows How to understand CALCULATE function in DAX. Calculate is one of the powerful functions in DAX language. This function will be a substitute for Excel’s SUMIF, COUNTIF, AVERAGEIF or ANYTHINGIF in reality. You can perform any kind of complex aggregate calculations using CALCULATE function.

Let’s understand that in detail..

CALCULATE Syntax:

=CALCULATE(<Expression>,<Filter1>,<Filter2>…)

  • Expression: This can be any aggregation like Sum, Count, Average..

Eg:

  • Sum of Sales:=SUM(SalesAmount)
  • No of Customers:=COUNTROWS(CustomerTable)
  • Average Profit:=AVERAGE(Sales(Profit)) 
  • Filter: This is can be any filter on the category. Like Product which is Red, Region which “East”

Eg: Product=”Red”, Region=”East”, Country=”Australia” etc.

 

Leave a Reply

Your email address will not be published. Required fields are marked *
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>