Excel CUBEKPIMEMBER Function
The CUBEKPIMEMBER function returns the key performance indicator (KPI) property and displays the KPI name in the cell.
Syntax
=CUBEKPIMEMBER(connection, kpi_name, kpi_property, [caption])
Arguments
- connection (required): A text string of the name of the connection tthe data model (cube).
- kpi_name (required): A text string of the name of the KPI in the cube.
- kpi_property (required): The KPI component returned and can be one of the enumerated constants in the following table:
-
Integer Enumerated constant Description 1 KPIValue The actual value 2 KPIGoal A target value 3 KPIStatus The state of the KPI at a specific moment in time 4 KPITrend A measure of the value over time 5 KPIWeight A relative importance assigned to the KPI 6 KPICurrentTimeMember A temporal context for the KPI - caption (optional): A text string that overwrites the kpi_name and kpi_property and displays in the cell.
Return Value
The CUBEKPIMEMBER function returns a KPI property.
Function Notes
- The #GETTING_DATA… message is displayed while the data is being retrieved.
- To use KPI in a calculation, nest the CUBEKPIMEMBER function as a member_expression argument in the CUBEVALUE function.
- CUBEKPIMEMBER returns the #NAME? error value if:
- connection is not a valid workbook connection stored in the workbook, e.g., ThisWorkbookDataModel;
- Online Analytical Processing (OLAP) server is unavailable, not running, or returned an error message.
- CUBEKPIMEMBER returns the #N/A error value if:
- kpi_name or kpi_property is not valid;
- reference a session-based object in pivot table when sharing a connection and the pivot table is deleted or to be converted to formulas.
- Arguments of CUBEKPIMEMBER, except kpi_property and cell references, should be closed with double quotes ("").
Example
I have a table here named “sales2021” which includes the information of sales and rating of different products of 2 categories across the year 2021. To use the CUBEKPIMEMBER function to get the total sales of both categories in 2021, you should first complete the following two steps:
- Add the data from this table to the Data Model in the existing workbook, its name will always be "ThisWorkbookDataModel".
- Add a KPI to your Data Model.
- Go to Data > Data Tools > Manage Data Model. Select the tab on the bottom of your specific data. Here I will select sale2021.
- Perform the necessary calculations. In this example, I will apply AutoSum on Sales column by first selecting the sales column and then click on AutoSum. You will see the Sum of Sales 2 measure is created as the below screenshot shown.
- Repeat the above step but apply Average from the drop-down list after you clicking the drop-down arrow besides AutoSum to create an Average measure.
- Right-click on the Sum measure and then select Create KPI. In the pop-up dialog, choose the Average of Sales 2 Measure in the drop-down menu, and then click OK.
Now the KPI is available in your data model, please copy or enter the formula below in the cell G21, and press Enter to get the result:
=CUBEKPIMEMBER("ThisWorkbookDataModel","Sum of Sales 2",1, "Total sales")
√ Note: You can get the corresponding KPI value by using the CUBEVALUE function in the cell H21:
=CUBEVALUE("ThisWorkbookDataModel","[Measures].[Sum of Sales 2]")
Related functions
The CUBEVALUE function returns an aggregated value from a cube filtered by multiple member_expression arguments.
The CUBEMEMBER function retrieves a member or tuple from a cube if it exists. Otherwise, a #N/A error value will be returned.
The CUBESET function defines a calculated set of members or tuples by sending a set expression to the cube on the server. The function can extract all unique values from a set expression, and it offers options for sorting.
The CUBESETCOUNT function returns the number of items in a set.
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)
- One second to switch between dozens of open documents!
- Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
- Increases your productivity by 50% when viewing and editing multiple documents.
- Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.
