Power BI • DAX • Pro Toolkit

Top 15 DAX Functions You Must Know

A practical, production-ready list: 10 core + 5 advanced functions. Master these and you cover most real-world modeling patterns.

🧠 Context control 📊 Iterators 🔎 Filtering 📅 Time intelligence ⚡ Pro patterns
1) CALCULATE() Context is everything
1

Change filter context for a measure

The single most important DAX function. It evaluates an expression under modified filters.

Sales USA =
CALCULATE(
    SUM(Sales[Amount]),
    Sales[Country] = "USA"
)
2) SUMX() Iterator
2

Row-by-row calculation and aggregation

Use when the result must be computed per row (not a simple SUM of a column).

Total Sales =
SUMX(
    Sales,
    Sales[Qty] * Sales[UnitPrice]
)
3) FILTER() Advanced filtering
3

Build a filtered table with custom logic

Often used inside CALCULATE for complex conditions.

High Sales =
CALCULATE(
    [Total Sales],
    FILTER(Sales, Sales[Amount] > 1000)
)
4) ALL() Remove filters
4

Ignore filters for totals and benchmarks

Key for % of total, global totals, and comparisons.

% of Total =
DIVIDE(
    [Total Sales],
    CALCULATE([Total Sales], ALL(Sales))
)
5) REMOVEFILTERS() Modern ALL alternative
5

Explicitly clear filters (recommended)

More readable than ALL in many scenarios.

Global Total =
CALCULATE(
    [Total Sales],
    REMOVEFILTERS(Sales[Country])
)
6) SELECTEDVALUE() Slicer-aware
6

Return the selected value (or a fallback)

Perfect for dynamic titles, tooltips, and conditional logic.

Selected Country =
SELECTEDVALUE(Sales[Country], "All Countries")
7) DIVIDE() Safe math
7

Division without errors

Avoids divide-by-zero issues and lets you set an alternate result.

Margin % =
DIVIDE([Profit], [Total Sales])
8) IF() Conditional logic
8

Branch your logic

Use with care—heavy nested IFs can hurt readability/performance.

Sales Tier =
IF([Total Sales] > 100000, "High", "Low")
9) VALUES() Distinct values
9

Get unique values respecting current context

Useful for counting distinct items via COUNTROWS(VALUES()).

Unique Customers =
COUNTROWS(VALUES(Sales[CustomerID]))
10) DATEADD() Time intelligence
10

Shift time (YoY, MoM, etc.)

Requires a proper Date table marked as a Date table.

Sales Last Year =
CALCULATE(
    [Total Sales],
    DATEADD('Calendar'[Date], -1, YEAR)
)
11) HASONEVALUE() Context validation
11

Check if a single value is in context

Great to prevent ambiguous calculations and show different logic by granularity.

Is Single Country =
HASONEVALUE(Sales[Country])
12) ISINSCOPE() Visual hierarchy
12

Detect the current hierarchy level in a visual

Perfect for Matrix/Hierarchy measures that behave differently at each level.

Show Only Product Level =
IF(
    ISINSCOPE(Products[Product]),
    [Total Sales],
    BLANK()
)
13) KEEPFILTERS() Intersection filters
13

Preserve existing filters while adding new ones

Ensures your added condition intersects with the current filter context.

Premium Sales =
CALCULATE(
    [Total Sales],
    KEEPFILTERS(Sales[Type] = "Premium")
)
14) TREATAS() Virtual relationships
14

Apply filters across tables without a physical relationship

A powerhouse for many-to-many or disconnected tables.

Sales by Region (Virtual) =
CALCULATE(
    [Total Sales],
    TREATAS(
        VALUES(Region[Region]),
        Sales[Region]
    )
)
15) USERELATIONSHIP() Inactive relationships
15

Activate an inactive relationship inside CALCULATE

Essential for models with multiple date fields (Order Date vs Ship Date).

Sales by Ship Date =
CALCULATE(
    [Total Sales],
    USERELATIONSHIP(Sales[ShipDate], 'Calendar'[Date])
)

📌 Quick Mental Model

  • CALCULATE changes the “rules of the room” (filter context).
  • X functions (like SUMX) compute row-by-row then aggregate.
  • ALL/REMOVEFILTERS/KEEPFILTERS are your context steering wheel.
  • TREATAS/USERELATIONSHIP unlock advanced modeling patterns.

⚡ Pro Tip

  • Prefer DIVIDE() over / for robust measures.
  • Use ISINSCOPE() to tailor measures by visual granularity.
  • Use KEEPFILTERS() when you need intersection instead of override.
  • Validate context with HASONEVALUE() to avoid surprises.