Mastering Power BI DAX: Essential Functions, Patterns & Cohort Analysis

  • author-image

    Super Admin

  • blog-tag DAX Patterns, Power Bi, CALCULATE, SUM, SUMX, COHORT ANALYSIS, Data Analytics, Data Analysis, Power Bi DAX, RELATED, RELATEDTABLE, FILTER, CALENDAR, LOOKUPVALUE, IF, RANK, RANKS, AVERAGE, AVERAGEX
  • blog-comment 0 comment
  • created-date 29 Sep, 2026
blog-thumbnail
  1. The CALCULATE() Function: The Engine of DAX

The CALCULATE function is the most powerful and fundamental function in Power BI DAX. It acts as the gateway to advanced data analysis because it allows you to modify or override the existing filter context of your report.

Think of it as a master controller: it evaluates a mathematical expression (like Sum, Average, or Count) but inside a newly defined set of custom rules/filters that you specify.

Syntax:

CALCULATE(<expression>, <filter1>, <filter2>, ...)

  • <expression>: The mathematical aggregation you want to perform (e.g., SUM(Sales[Amount])).
  • <filter1>, <filter2>: The new conditions or rules you want to force upon that expression.

Example & Dataset

Imagine you have a basic retail sales table named Sales containing data for different regions and product categories:


Sample Data Table: Sales


The DAX Code

If you want to create a dedicated measure that only calculates sales for the North region, you write this:

North Region Sales =

CALCULATE(

    SUM(Sales[Amount]),

    Sales[Region] = "North"

)

Expected Output Visual

When you drag the native Category column and this new [North Region Sales] measure into a Table Visual, Power BI will generate this exact output:

Output Table Visual:

OrderID

Region

Category

Amount

101

North

Electronics

500

102

South

Electronics

300

103

North

Furniture

700

104

West

Electronics

400

105

North

Clothing

200


Category

Standard Total Sales (Default)

North Region Sales (Our Measure)

Clothing

200

200

Electronics

1200

500 (Only Order 101)

Furniture

700

700

Total

2100

1400

author_photo
Super Admin

0 comment