Cube.Dimensions

Table

Returns a table containing the set of available dimensions within a cube.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Cube.Dimensions(cube as table) as table

Parameters

NameTypeRequiredDescription
cubetableYesThe cube table to retrieve dimensions from.

Return Value

tableA table listing the available dimensions in the cube, where each dimension contains a set of dimension attributes.

Remarks

Cube.Dimensions returns a table containing the set of available dimensions within the specified cube. Each dimension is itself a table containing a set of dimension attributes, and each dimension attribute is represented as a column in the dimension table.

Dimensions are the primary organizational structures in an OLAP cube. They represent the axes along which data can be analyzed -- for example, Time, Product, Geography, or Customer. Each dimension contains one or more hierarchies and attributes that define how data can be sliced and aggregated.

Dimensions from this table can be expanded into the cube using Cube.AddAndExpandDimensionColumn. The dimension selector values from this table are passed as the dimensionSelector argument.

Examples

Example 1: List all dimensions in a cube

let
    Source = AnalysisServices.Database("localhost", "AdventureWorks"),
    Cube = Source{[Name = "Adventure Works"]}[Data],
    Dims = Cube.Dimensions(Cube)
in
    Dims

Example 2: Navigate dimensions to expand attributes

let
    Source = AnalysisServices.Database("localhost", "AdventureWorks"),
    Cube = Source{[Name = "Adventure Works"]}[Data],
    Dims = Cube.Dimensions(Cube),
    ProductDim = Dims{[Name = "Product"]}[Value],
    WithProduct = Cube.AddAndExpandDimensionColumn(
        Cube,
        ProductDim,
        {"[Product].[Product Name]"}
    )
in
    WithProduct

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks