Finding the Nth Highest Value

Version 2



    This calculation(s) uses parameters and table calculations to find the desired Nth value from a list. This example uses Superstore. It is important to note that the values are based on the Customer field that has been sorted in descending order based on sum of Sales.



    Example Calculation:


    //Create an integer parameter that starts with 0 (in this example the parameter is [Return Nth Value])

    if index()=1 then

    WINDOW_MAX(sum([Sales]), first()+[Return Nth Value], last())





    Inputs and Setup:


    Place the above calculation on the text shelf. Place the desired dimension (in this case Customer) on the level of detail shelf.



    Partitioning and Addressing:


    Set the above calculation to Compute Using>Customer (or applicable dimension).





    Adopted from Joe Mako's example found here:



    Related Functions:





    Further Reading/Examples: