Skip to main content

Excel CUBEVALUE Function

The CUBEVALUE function returns an aggregated value from a cube filtered by multiple member_expression arguments.

cubevalue function 1


Syntax

=CUBEVALUE(connection, [member_expression1], [member_expression2], ...)


Arguments

  • connection (required): A text string of the name of the connection to the data model (cube).
  • member_expression (optional): A text string of a multidimensional expression (MDX) you want to evaluate. Alternatively, member_expression can be a set defined with the CUBESET function. member_expression can be used as a slicer to define the portion of the cube for which an aggregated value is to be returned. If member_expression is not supplied for any measures, the default measure for the cube is used.

Return Value

The CUBEVALUE function returns the aggregated value from a cube.


Function Notes

  • The #GETTING_DATA… message is displayed while the data is being retrieved.
  • CUBEVALUE 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.
  • CUBEVALUE returns the #VALUE! error value if:
    • There is one or more invalid elements in the tuple;
    • member_expression is longer than 255 characters. Note: You can enter the text string in a cell and then reference the cell as the argument as a workaround.
  • CUBEVALUE returns the #N/A error value if:
    • member_expression is not valid;
    • The member specified by member_expression does not exist in the cube;
    • The set contains one or more members with a different dimension than the other members;
    • The tuple in the member_expression argument is not valid since there is no intersection for the specified values.
  • Arguments of CUBEMEMBER, except cell references, should be closed with double quotes ("").
  • Names of members, dimensions or tables, etc. you write in member_expression should be wrapped in square brackets ([ ]).
  • If the intersection for the specified values contains no value, CUBEVALUE returns a Null value, i.e., a zero-length string. Note that if you perform mathematical operations on the cell with the Null value, say A1 (Null value) + A2, the #VALUE! error will be returned. To prevent this, you can test for a zero-length string by using the ISTEXT function and replace the zero-length with 0 by using the IF function as shown in the following example: =IF(ISTEXT(A1),0,A1)+IF(ISTEXT(A2),0,A2).

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 CUBEVALUE function to get the total sales of caps in May and June, you should first add the data from this table to the Data Model in the existing workbook, its name will always be ThisWorkbookDataModel. Then please copy or enter the formula below in the cell H8 where you want to calculate the sales, and press Enter to get the result:

=CUBEVALUE("ThisWorkbookDataModel",$G$5,$G8,H$5)

Where

$G$5 =CUBEMEMBER("ThisWorkbookDataModel","[Measures].[Sum of Sales]","Sales")

$G8 =CUBESET("ThisWorkbookDataModel",($G$6,$G$7),"Sales of May and June")
Where
$G$6 =CUBEMEMBER("ThisWorkbookDataModel","[sales2021].[Month].&[May]")
$G$7=CUBEMEMBER("ThisWorkbookDataModel","[sales2021].[Month].&[June]")

H$5 =CUBEMEMBER("ThisWorkbookDataModel","[sales2021].[Product].&[Caps]")

√ Note: The dollar signs before the row number and/or column alphabet in the cell reference make the row and/or column fixed, so that they won’t change when you drag or copy the formula. After entering the formula, you can drag the fill handle to the right to show results for other products.

cubevalue function 2


Related functions

Excel CUBEMEMBER Function

The CUBEMEMBER function retrieves a member or tuple from a cube if it exists. Otherwise, a #N/A error value will be returned.

Excel CUBEVALUE Function

The CUBEVALUE function returns an aggregated value from a cube filtered by multiple member_expression arguments.

Excel CUBEKPIMEMBER Function

The CUBEKPIMEMBER function returns the key performance indicator (KPI) property and displays the KPI name in the cell.

Excel CUBESETCOUNT Function

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 AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates  |  Delete Blank Rows  |  Combine Columns or Cells without Losing Data  |  Round without Formula ...
Super VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup...
Adv. Drop-down List: Easy Drop Down List  |  Dependent Drop Down List  |  Multi-select Drop Down List...
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  Compare Columns to Select Same & Different Cells ...
Featured Features: Grid Focus  |  Design View  |  Big Formula Bar  |  Workbook & Sheet Manager | Resource Library (Auto Text)  |  Date Picker  |  Combine Worksheets  |  Encrypt/Decrypt Cells  |  Send Emails by List  |  Super Filter  |  Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters ...)  |  50+ Chart Types (Gantt Chart ...)  |  40+ Practical Formulas (Calculate age based on birthday ...)  |  19 Insertion Tools (Insert QR Code, Insert Picture from Path ...)  |  12 Conversion Tools (Numbers to Words, Currency Conversion ...)  |  7 Merge & Split Tools (Advanced Combine Rows, Split Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

Description


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.
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations