Cube.CollapseAndRemoveColumns

Updated on

Cube.CollapseAndRemoveColumns is a function in the Power Query M language that changes the dimensional granularity of a cube’s filter context by collapsing attributes mapped to specified columns. The function returns a modified cube with the columns removed and the new dimensional granularity.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Cube.CollapseAndRemoveColumns(
   cube as table,
   columnNames as list,
) as table

Description

Changes the dimensional granularity of the filter context for the cube by collapsing the attributes mapped to the specified columns columnNames. The columns are also removed from the tabular view of the cube.

Other functions related to Cube.CollapseAndRemoveColumns are:

BI Gorilla Youtube Channel

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/cube-collapseandremovecolumns