# Can CUBEMEMBER be used to retrieve data from Data Model?



## cr731 (Mar 13, 2016)

I have a table in my data model and one column is ID and another Description.

I'm wondering if I can use CUBEMEMBER functions in Excel to return the Description of a given ID.

So say I want to enter an ID in cell A5 and have the description come back in B5.

I was wondering how this could be done and/or if there is any other way to lookup data in the data model in an Excel worksheet?  

Thanks


----------



## ImkeF (Mar 14, 2016)

This article describes a workaround for creating the results of the CUBEMEMBERPROPERTY-function in Power Pivot (where this function is missing).


----------



## Matt Allington (Mar 14, 2016)

I suggest you write a DAX measure that returns the description. Something like this.  

MyDescription=if(hasonevalue(table[ID]),values(table[Description]))

The above will return the description when there is a single value for ID

Then in Excel, write a cubevalue formula that calls this measure (from memory - I'm not at my PC)

=cubevalue("ThisWorkbookDataModel","[measures].[myDescription]","

.[ID].&["&A5&"]")

put a valid ID in cell A5 and keep your fingers crossed.


----------

