Tutorial with example
Learn how to use the DAX RANKX() function to arrange your data based on criteria that you specify.
– Rankx on categories 03:00
– Rank ascending 03:17
– Rank with allselected 03:35
– Rank with blanks 05:28
– Rank on products 07:26
– Rank with column 10:50
Exercise2: Rank with a slicer
In this video you will learn how to create a custom slicer that will rank your data based on the criteria that you specify, for example, Top 3, Top 5 and Top 10.
Exercise 3: Break Rank ties
In this video I will show you how DAX RAND function works and also how to use it to break ties on the RANKX calculation to be able to create TOP X lists in Power BI.
Exercise 4: Dynamic TopN+Others
In this video we will use the dax function RANKX to create a dynamic TOP N elements and categorize the rest as others.
Download example file:
To get the files:
1. Go to Curbal Download Center > Dax Fridays
2. Get File #132
- If expression or value evaluates to BLANK it is treated as a 0 (zero) for all expressions that result in a number, or as an empty text for all text expressions.
- If value is not among all possible values of expression then RANKX temporarily adds value to the values from expression and re-evaluates RANKX to determine the proper rank of value.
- Optional arguments might be skipped by placing an empty comma (,) in the argument list, i.e. RANKX(Inventory, [InventoryCost],,,”Dense”)