
📎 This article includes 1 downloadable practice file ↓
In this article
CUBESET defines a sorted set from the Data Model — combine it with CUBERANKEDMEMBER for top-10 lists that update themselves.
Syntax
=CUBESET(connection, set_expression, , [sort_order], [sort_by])
| Argument | What it means |
|---|---|
sort_order |
2 = descending. |
Examples
Example 1
=CUBESET("ThisWorkbookDataModel", "[Products].[Product].Children", "Products", 2, "[Measures].[Revenue]")
All products sorted by revenue.
CUBESET in practice
Where you will use it
- Define a set like all customers
- Feed CUBERANKEDMEMBER for Top N lists
- Dynamic lists from the model
Worked example
| Workbook | Formula | Result |
|---|---|---|
| Has a Data Model | =CUBESET("ThisWorkbookDataModel","[Customer].[Name].Children","Customers") | (value from your Data Model) |
Needs a Power Pivot Data Model, so this example is not calculated here: the result is whatever your model holds.
Mistakes people make
| Mistake | What to do instead |
|---|---|
| Wrong connection name | Use ThisWorkbookDataModel for Power Pivot |
| Typos in names | Build them with PivotTable > OLAP Tools > Convert to Formulas |
Related functions
📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.
Test formulas dynamically in our web formula laboratory or download the companion Excel workbook.
📎 Practice files for this article
- 📗Practice workbook: Lookup & reference17 tasks on realistic sales data — type your formula, the Check column turns green when it is right. Answers sheet included.⬇ XLSX · 35 KB
Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.
Atul (AJ) builds office-automation and local-first AI tools as Atulya AI, and works with Excel, SAP and Oracle EPM every day. He writes about the shortcuts, macros and automations that actually save time — plus the occasional wacky fact. Videos on YouTube: Lazy Automator AI (@LazyAutomatorAI).
More posts by Atul →Build this skill next
This page is a quick function reference. Use it for syntax, then practise the function in a broader workflow.
Stuck on a step? Ask a question and the AI answers using this article.