I want to use some sort of lookup to return multiple results from a large table. The table I am referencing is more than 1 million rows, so I consolidate into a data model.
If I were using a regular table then this example XLOOKUP would give me what I want;
Formula:
=XLOOKUP({"0102030405";"0102030408";"0102030411"},Table1[Lookup],Table1[Result])
This formula would then return 3 results in a Spill Array. (There is always only 1 result per lookup value)
I have only recently discovered the data model, so pretty fresh with it, but as I understand I need to use a CUBE function.
If I am only looking up 1 value then this formula works;
Formula:
=CUBEVALUE("ThisWorkbookDataModel","[Lookup].["&{"0102030405"}&"]",CUBEMEMBER("ThisWorkbookDataModel","[Measures].[Sum of Result]"))
But as soon as I try to expand the formula to lookup and return more than one result it does not work (Get #N/A result);
Formula:
=CUBEVALUE("ThisWorkbookDataModel","[Lookup].["&{"0102030405";"0102030408"}&"]",CUBEMEMBER("ThisWorkbookDataModel","[Measures].[Sum of Result]"))
Like I say I am pretty new to data models and cube functions so probably don't understand the capability fully.
Is there a way to edit above cube formula to return multiple results? Or perhaps a different method all together, any guidance gratefully received.
I do not attach an example workbook as imagine it will be pretty huge if I try to share data model.
This post relates to Windows Excel (not Mac).
Bookmarks