The CUBEVALUE function in Excel is a powerful tool designed to retrieve aggregated values from a multi-dimensional data source, or cube. This functionality is particularly useful for data analysis and reporting, allowing users to extract meaningful insights from large datasets efficiently.
Syntax
CUBEVALUE(connection, member_expression1, [member_expression2, ...])
- connection: A text string that specifies the connection to the data source.
- member_expression1: An expression that identifies a member of the cube being evaluated.
- member_expression2: Optional. Additional member expressions for further refinement.
Example #1
CUBEVALUE("Data_Sales", "[Measures].[Total Sales]", "[Product].[All Products]")
This function retrieves the total sales for all products from the ‘Data_Sales’ connection. Result: $5,000,000.
Example #2
CUBEVALUE("Data_Expenses", "[Measures].[Total Expenses]", "[Region].[North America]")
This function fetches the total expenses for the North America region from the ‘Data_Expenses’ connection. Result: $2,000,000.
Example #3
CUBEVALUE("Data_Profit", "[Measures].[Total Profit]", "[Year].[2022]")
This function provides the total profit for the year 2022 from the ‘Data_Profit’ connection. Result: $3,000,000.
Error handling
- VALUE!: This error occurs when one or more of the parameters are not valid. Ensure all connections and expressions are correct.
- N/A: Indicates that there is no data available for the provided member expressions. Check if the members exist in the cube.
- NAME?: This error is shown if there is a spelling mistake in the function name. Verify that ‘CUBEVALUE’ is typed correctly.