Cube.Transform

Cube.Transform is a function in the Power Query M language that applies the list of cube functions, transforms, on the cube.

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

Syntax

Cube.Transform(
   cube as table,
   transforms as list,
) as table

Description

Applies the list cube functions, transforms, on the cube.

Examples

Here’s an example on how you can use the Cube.Transform function:

let
  Source         = SapHana.Database ( "server:30015", [ Implementation = "2.0" ] ), 
  Contents       = Source{ [Name = "Contents" ]}[Data], 
  ADVENTUREWORKS = Contents { [Name = "ADVENTUREWORKS" ] }[Data], 
  AN_SALES2      = ADVENTUREWORKS{ [ Name = "AN_SALES1" ] }[Data], 
  AddedItems = 
    Cube.Transform (
      AN_SALES2, 
      {
        { Cube.ApplyParameter, "Var3", { SapHanaRangeOperator.GreaterThan, 1, null } }, 
        { Cube.AddMeasureColumn, "Average Sale Per Order", "[Measures].[AverageSalePerOrder]" }
      }
    )
in
  AddedItems

Other functions related to Cube.Transform are:

BI Gorilla Blog

Last update: August 17, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/cube-transform
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.