By Andrew Gould
Download files here https://www.wiseowl.co.uk/power-bi/videos/dax-powerbi/dax-rankx-function/
If you'd like to help fund Wise Owl's conversion of tea and biscuits into quality training videos you can join this channel to get access to perks:
https://www.youtube.com/channel/UCbi5G5PjWBaQUFy7XU_O7yw/join
Or you can click this link https://www.wiseowl.co.uk/donate?t=1 to make a donation. Thanks for watching!
This video introduces the concept of ranking values in DAX using the RANKX function. You'll see a quick overview of the RANKX, RANK.EQ and RANK functions before using the RANKX function to create a calculated column. You'll learn how to control the sort order of the ranking, as well as how to deal with tied results using either a Skip or Dense rank. You'll also see how to use the RANKX function to rank aggregated values in a measure, including how to use the ALL function to ensure the ranking is evaluated correctly. You'll learn how to hide ranked values on total rows in a visual using the HASONEVALUE or ISINSCOPE functions, and how to use ALLSELECTED to rank only the values currently displayed in the visual. You'll also see how to return only the top 3 results based on the rank. The final part of the video explains how to calculate ranks for different levels of a group hierarchy in a matrix visual, including how to calculate subtotals correctly, and how to return a rank for each level of grouping.
Chapters
00:00 Topic list
00:52 Ranking in Calculated Columns
04:52 Changing the Rank Order
06:43 Dealing with Tied Results
08:03 Filtering with Ranked Values
11:04 Using RANKX in Measures
14:33 Hiding Ranks for Total Rows
16:34 Ranking Visible Categories Only
18:18 Returning Only the Top 3 Results
21:25 Returning the Top 3 Results per Group
22:22 Adjusting the Subtotals
26:46 Ranking Subtotals
Visit https://www.wiseowl.co.uk for more online training resources in Microsoft Excel, Microsoft Power BI, DAX, VBA, Python, Visual C#, Microsoft SQL Server, SQL Server Reporting Services SSRS, SQL Server Integration Services SSIS, Microsoft Access and more!