Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Dynamic Table Rank - how to get this to work?

I've been trying to use the rank function such as:  Rank with Visuals applied   However, when I apply this to my PBI my ranks go from 1 to 1700 or so (depending on what's in the table).  However, s...
  • Mariusz's avatar
    Mariusz
    7 years ago

    Hi Anonymous 

    Try the below

    Rank = 
    VAR tbl = CALCULATETABLE(
        VALUES(FactSales[Aging]),
        ALLSELECTED()
    )
    RETURN 
    RANKX(
        tbl, 
        ROUND(
            CALCULATE(
                AVERAGE(FactSales[Aging]),
    	        DATESYTD(FactSales[ClosedDate]),
    	        FILTER ( 
                    FactSales, 
                    AND ( 
                        FactSales[Scorecard Bucket] IN { "FILTERS"},  
                        FactSales[OpenClosed] IN {"Closed" } 
                    )
                )
            ),
            1
        ),,,
        Dense
    )
    
    


    Regards,
    Mariusz

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.