4 Context shaping-core functions
This chapter covers
- Identifying filter-shaping core functions
- Using VALUES to extract distinct values
- Creating custom tables with SELECTCOLUMNS and ADDCOLUMNS
- Grouping data using SUMMARIZECOLUMNS
- Filtering rows with FILTER and CALCULATETABLE
- Combining core functions to build flexible, reusable logic
Most DAX measures do not start with a number—they start with a table.
Even when a measure returns a single scalar, the engine first determines which rows are visible under the current filter context, then aggregates over that rowset. In Power BI, that rowset is shaped continuously by slicers, visual interactions, and relationships in the semantic model. Context-shaping functions are the tools that let you take control of that process.
The focus here is on a practical set of table and filter-context functions that do not alter the semantic model itself but do change the table expressions evaluated within it. They make it possible to construct virtual recordsets that behave much like subqueries, make visible scope explicit, and write measures that remain stable as users slice, drill, and cross-filter a report.
The progression starts with the simplest idea: identifying which values are currently visible. From there, we move into creating custom tables, grouping rows, and applying filters deliberately so that DAX logic stays readable, flexible, and interaction safe.