COLLAPSE DAX Function (Visual calculations)
Retrieves a context with removed detail levels compared to the current context. With an expression, returns its value in the new context, allowing navigation up hierarchies and calculation at a coarser level of detail.
Syntax
Parameter | Attributes | Description |
---|---|---|
Expression | Optional |
The expression to be evaluated in the new context. |
Axis | Optional |
An axis reference. |
Column | Optional Repeatable |
A column in the data grid. |
N | Optional |
The number of levels to collapse. If omitted, the default value is 1. |
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 COLLAPSE in the following articles:
-
Introducing VISUAL SHAPE for visual calculations in Power BI
This article introduces the VISUAL SHAPE clause, which defines a hierarchical structure for a table used in visual calculations. » Read more
-
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
Last update: Dec 16, 2024 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
Microsoft documentation: https://learn.microsoft.com/en-us/dax/collapse-function-dax