Cube formulas

Matias D

New Member
Joined
May 2, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am new to the cube functions and also new to this forum so any help is greatly appreciated.
I am working with a simple table that has 2 columns, Column A: Person with text values Anna, Chuck, Kelly and Cassandra. Column B: Region with text values central, west, south and east.
1588440664686.png


Using the cubeset and cuberankedmemeber i am able to produce a list that contains the person names. But then i am not able to produce a cube formula that retrieves the region name for each person name. It is possible to do this using cube formulas? I tried using cubset and cuberankedmember but not any positive result. Thanks!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Welome @Matias D - An initial warning, I am a newbie with cube formulas in Pivot Tables, so take this for what it is. Using a table similar to yours and (a) creating a connection and Pivot table, (b) a copy of that converted to formulas (with the RegionL being a function shown in the screenshot), you can access the regions with a formula, but perhaps not in a straight-through way (because I don't know whether the function can be replicated in an in-line, standalone cell's formula). Anyway, perhaps this will help:
Book1
ABCDEFGH
1PersonRegionRow LabelsRegionLRow LabelsRegionL
2AnnWAnnWAnnW
3ChuckECassSCassS
4KelCChuckEChuckE
5CassSKelCKelC
6Grand TotalW.E.C.SGrand TotalW.E.C.S
7
8Table1Converted to formulasPivot Table
Sheet1
Cell Formulas
RangeFormula
E1E1=CUBEMEMBER("ThisWorkbookDataModel","[Measures].[RegionL]")
D2D2=CUBEMEMBER("ThisWorkbookDataModel","[Table1].[Person].&[Ann]")
E2:E6E2=CUBEVALUE("ThisWorkbookDataModel",$D2,E$1)
D3D3=CUBEMEMBER("ThisWorkbookDataModel","[Table1].[Person].&[Cass]")
D4D4=CUBEMEMBER("ThisWorkbookDataModel","[Table1].[Person].&[Chuck]")
D5D5=CUBEMEMBER("ThisWorkbookDataModel","[Table1].[Person].&[Kel]")
D6D6=CUBEMEMBER("ThisWorkbookDataModel","[Table1].[Person].[All]","Grand Total")

1588478730247.png
 
Last edited:
Upvote 0
Ohhhh yes many thanks!, looks like the key is to define a measure using the concatenatex function to then retrieve using cubevalue function.
Thanks again!
 
Upvote 0
It's disappointing that something so useful and popular is so oddly difficult to achieve. There's no documentation on this except in occasional spots on the web. The cube formula to obtain the value of a row in the same table but a different column than the one you have selected is:

a) a slicer returns the value you're using for a lookup to (say) cell $B$3. This formula in cell $B$3 returns the selected slicer value
=CUBERANKEDMEMBER("ThisWorkbookDataModel",Slicer_SlicerName,1)
you can have a different way to get the lookup value you want, you just need that value to pass to the 2nd formula below.

b) this formula takes the slicer selected value and returns the other column value associated with the same row
=CUBERANKEDMEMBER("ThisWorkbookDataModel",CUBESET("ThisWorkbookDataModel","([SourceTable].[SelectedColumn].["&$B$3&"],[SourceTable].[ReturnColumn].children)"),1)

MSFT should really put out better documentation on the CUBE formulas!
 
Upvote 0
Thank you @macfuller . Totally agree with you that the cube formulas documentation is very poor. In other words the idea is to set a cubeset that has 1 child from the return column that results from the combination of selected column & cell B3. Then use cuberankedmember to retrieve this only child as a result. Using this method we can avoid creating a measure as described above. Thanks again. Always happy to learn something new :)
 
Upvote 0

Forum statistics

Threads
1,223,606
Messages
6,173,323
Members
452,510
Latest member
RCan29

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top