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 the zero-based ordinal value associated with a level.
Level_Expression.Ordinal
Level_Expression
A valid Multidimensional Expressions (MDX) expression that returns a level.
The Ordinal function is frequently used in conjunction with the IIF and CurrentMember functions to conditionally display different values at different hierarchy levels, based on the ordinal position of each specific cell in the query result. For example, you can use the Ordinal function to perform calculations at certain levels and display a default value of "N/A" at other levels.
The following example returns the ordinal number for the Calendar Quarter level in the Calendar hierarchy.
WITH MEMBER Measures.x AS [Date].[Calendar].[Calendar Quarter].Ordinal
SELECT Measures.x 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