Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Returns a subset of tuples from a specified set.
Subset(Set_Expression, Start [ ,Count ] )
Set_Expression
A valid Multidimensional Expressions (MDX) expression that returns a set.
Start
A valid numeric expression that specifies the position of the first tuple to be returned.
Count
A valid numeric expression that specifies the number of tuples to be returned.
From the specified set, the Subset function returns a subset that contains the specified number of tuples, beginning at the specified start position. The start position is based on a zero-based index; that is, zero (0) corresponds to the first tuple in the specified set, 1 corresponds to the second, and so on.
If Count is not specified, the function returns all tuples from Start to the end of the set.
The following example returns the Reseller Sales Measure for the top five selling subcategories of products, irrespective of hierarchy, based on Reseller Gross Profit. The Subset function is used to return only the first five sets in the result after the result is ordered using the Order function.
SELECT Subset
(Order
([Product].[Product Categories].[SubCategory].members
,[Measures].[Reseller Gross Profit]
,BDESC
)
,0
,5
) ON 0
FROM [Adventure Works]
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today