Skip to main content

Command Palette

Search for a command to run...

MDX Functions: BottomCount

Updated
1 min read
MDX Functions: BottomCount
B

Bradley Schacht is a Principal Program Manager on the Microsoft Fabric product team based in Saint Augustine, FL. Bradley is a former consultant, trainer, and has coauthored 6 SQL Server and Power BI books, most recently Learn Microsoft Fabric. As a member of the Microsoft Fabric product team, Bradley works directly with customers to solve some of their most complex data problems and helps shape the future of Microsoft Fabric. Bradley gives back to the community through speaking at events such as the SQLBits, Fabric Community Conference, PASS Community Data Summit, SQL Saturdays, Code Camps, and user groups across the country including locally at the Jacksonville SQL Server User Group (JSSUG). He is a contributor on SQLServerCentral.com and blogs on his personal site, BradleySchacht.com.

The MultiDimensional eXpressions, or MDX, language is used to query the data in a multidimensional in an OLAP database. In the case of examples here, SQL Server Analysis Services. This example uses the Contoso demo cube available for download here: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=18279 Function Name: BottomCount Use Case: Brings back the lowest X number of values from a set MSDN Link: http://msdn.microsoft.com/en-us/library/ms144864.aspx Notes: Always breaks a hierarchy Syntax: BOTTOMCOUNT(<>, Number of Tuples to return, <>) Sample Query: SELECT [Measures].[Online Sales Amount] ON COLUMNS, BOTTOMCOUNT( [Product].[Product Category].CHILDREN, 2, [Measures].[Online Sales Amount] ) ON ROWS FROM [Contoso] Sample Results:

More from this blog

B

Bradley Schacht - Development

172 posts

Bradley Schacht is a Principal Program Manager on the Microsoft Fabric product team based in Saint Augustine, FL.