CUBEVALUE function with multiple dimension members

I'm using Excel 2007 to query a cube in SSAS.
I need to get the total of a measure, for a subset of Dimension members.

Say that the measure is TotalSales, and there's a Salesman dimension with 3 members :Fred, George and Jim.

I need the combined  total sales for Fred and George .
The function for getting the total sales for one salesman is:-


But when I try to add another salesman, I get #NA


Can anyone help?

Who is Participating?
agandauConnect With a Mentor Commented:
Try this:

=CUBEVALUE("jago","[TotalSales]",CUBESET("jago", "{[Salesman].&[Fred],[Salesman].&[George]}"))
WizzoPAuthor Commented:
YES. That's perfect. Many thanks agandau.
Hi agandau:,

Do you have an idea on how to use the same function when we are referring to two members of the same hierarchy? I am  facing a #N/A error when I try to use the cubeset formula on two members of the same hierachy.

=CUBEVALUE("CubeConnection","[Measures].[Amount]",CUBESET("CubeConnection","{[Account Hierarchy].[Account Hierarchy].&[800000],[Account Hierarchy].[Account Hierarchy].&[900000]}"))
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.