Back to Roadmap
Level 6 — Advanced DAX Mastery+80 XP
Lesson 2

2. Virtual Tables with VALUES & SUMMARIZE

Constructing temporary tables in memory inside a measure.

The Concept

Virtual tables allow you to group, summarize, and aggregate data without altering the physical model.
Example DAX:
Total Revenue of Active Customers = 
VAR ActiveCustomers = VALUES(Sales[CustomerID])
RETURN
    CALCULATE(
        [Total Revenue],
        ActiveCustomers
    )

VALUES returns a one-column table of unique values in the current filter context. You can pass it directly to CALCULATE as a filter table.

Try It Yourself

Write a measure using COUNTROWS(VALUES(Sales[ProductID])) to count distinct active products.

fx
[fx]Virtual Tables with VALUES & SUMMARIZE=
Loading DAX Formula Studio...
Type [ for fields