Cube function

CUBEKPIMEMBER function

Returns a key performance indicator (KPI) property - value, goal, status or trend - from a Data Model or cube, for use in CUBEVALUE.

Available in Excel 2007 and later for Windows, Microsoft 365, Excel for the web (with Data Model or supported OLAP sources); Excel for Mac 2016+ for the Data Model

Excel 2007 and laterNot in Google Sheets

Syntax

CUBEKPIMEMBER(connection, kpi_name, kpi_property, [caption])
ArgumentWhat it means
connectionRequiredThe cube connection name, e.g. "ThisWorkbookDataModel".
kpi_nameRequiredThe name of the KPI. In the Data Model this is the name of the measure the KPI is built on, e.g. "Total Revenue".
kpi_propertyRequired1 value, 2 goal, 3 status, 4 trend, 5 weight, 6 current time member.
captionOptionalText to display in the cell instead of the default caption.

Returns: A KPI member. The cell shows its caption; CUBEVALUE returns the number behind it.

How CUBEKPIMEMBER works

A KPI is a measure with a target attached. In Power Pivot you can turn a measure such as Total Revenue into a KPI by giving it a goal (a fixed number or another measure) and status thresholds; on an Analysis Services cube, KPIs are designed by the cube's developer. CUBEKPIMEMBER fetches one part of a KPI - its current value, its goal, its status or its trend - so you can show it in a report next to regular cube formulas.

The examples use the sample Sales table (Rep, Region, Product, Units, Revenue) loaded into the workbook's Data Model - for example by ticking Add this data to the Data Model when inserting a PivotTable, or by loading it from Power Query. The Data Model's connection is always called ThisWorkbookDataModel, and a measure named Total Revenue (=SUM(Sales[Revenue])) was added with Power Pivot or the Add Measure command. A KPI was added to Total Revenue with an absolute target of 5000 and status thresholds at 80% and 100% of the target, so the status is -1 below 80%, 0 between 80% and 100%, and 1 at or above the target.

The function itself only returns a member, and the cell shows a caption. To get the number, reference the cell from CUBEVALUE together with any slicing members, such as a region. The status comes back as -1, 0 or 1, which you can show with an icon set in conditional formatting.

Examples

1Goal of the revenue KPI

A2fx=CUBEKPIMEMBER("ThisWorkbookDataModel", "Total Revenue", 2, "Revenue goal")
A
1
2Revenue goal

Result: Revenue goal

Property 2 is the goal. The cell shows the caption; =CUBEVALUE("ThisWorkbookDataModel", A2, "[Sales].[Region].[All].[North]") in B2 returns 5000.

2Status for North

B3fx=CUBEVALUE("ThisWorkbookDataModel", CUBEKPIMEMBER("ThisWorkbookDataModel", "Total Revenue", 3), "[Sales].[Region].[All].[North]")
AB
1
2
30

Result: 0

North's revenue is 4638, which is 92.8% of the 5000 goal - between the 80% and 100% thresholds - so the status is 0 (amber).

3Current value for North

B4fx=CUBEVALUE("ThisWorkbookDataModel", CUBEKPIMEMBER("ThisWorkbookDataModel", "Total Revenue", 1), "[Sales].[Region].[All].[North]")
AB
1
2
3
44638

Result: 4638

Property 1 is the KPI's value, which is simply the measure: North's total revenue.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 14 KB

Common errors and how to fix them

ErrorWhy it happensFix
#N/AThe KPI name does not exist or the measure has no KPI defined.Check the KPI in Power Pivot (Home > Create KPI) or in the cube's design.
#GETTING_DATAData is still loading.Wait a moment.

Tips

  • Apply a three-icon set to the status cells (-1, 0, 1) for traffic lights.
  • Weight (5) and current time member (6) are only meaningful on Analysis Services cubes that define them.

Google Sheets

No OLAP cube functions or KPIs; calculate the KPI with ordinary formulas or a pivot table.

CUBEKPIMEMBER in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
DanishKUBE.KPI.MEDLEM
DutchKUBUSKPILID
FinnishKUUTIOKPIJÄSEN
FrenchMEMBREKPICUBE
GermanCUBEKPIELEMENT
HungarianKOCKA.FŐTELJMUT
ItalianMEMBRO.KPI.CUBO
Norwegian (Bokmål)KUBEKPIMEDLEM
PolishELEMENT.KPI.MODUŁU
Portuguese (Brazil)MEMBROKPICUBO
Portuguese (Portugal)MEMBROKPICUBO
RussianКУБЭЛЕМЕНТКИП
SpanishMIEMBROKPICUBO
SwedishKUBKPIMEDLEM
TurkishKÜPKPIÜYESİ