COLLAPSEALL DAX Function (Visual calculations)
Retrieves a context with removed detail levels along an axis. With an expression, returns its value in the new context, enabling navigation to the highest level on the axis and is the inverse of EXPANDALL.
Syntax
| Parameter | Attributes | Description |
|---|---|---|
| Expression | Optional |
The expression to be evaluated in the new context. |
| Axis |
An axis reference. |
Notes
The visual calculation functions have an axis parameter that is defined in the VISUAL SHAPE query syntax produced by the visual calculation feature in Power BI.
Related articles
Learn more about COLLAPSEALL in the following articles:
-
Introducing EXPAND and COLLAPSE for visual calculations in Power BI
This article introduces the two basic visual context navigation functions: EXPAND and COLLAPSE. » Read more
-
Using EXPAND and COLLAPSE in visual calculations
This article provides examples of visual calculations where the use of EXPAND and COLLAPSE is required to obtain the correct result. » Read more
-
SQLBI+ updates in April 2026
We released a new session in SQLBI+: How to navigate the lattice of visual calculations: This video explains how to navigate the lattice of visual calculations in DAX, using COLLAPSEALL and EXPAND to move between levels. A key topic is the difference between ROWS/COLUMNS and VALUES of ROWS/COLUMNS. The video also shows how to create reusable visual calculation functions that encapsulate lattice navigation logic, simplifying otherwise complex code. Stay tuned for new SQLBI+ content coming in 2026! » Read more
-
Using visual calculations to highlight an entire row
Visual calculations can be used efficiently to format visuals. This article presents an interesting technique to highlight a row based solely on the maximum value in the last column. » Read more
Last update: Apr 29, 2026 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
Microsoft documentation: https://learn.microsoft.com/en-us/dax/collapseall-function-dax