Forum Discussion

kjmts5200's avatar
kjmts5200
Frequent Visitor
5 years ago
Solved

Dynamic Rank Measure

Hi,   I have a query that brings in all stock symbols traded each day by shares traded.  So the dataset looks like this but its shows by day for the last 13 months (there are millions of rows of da...
  • v-janeyg-msft's avatar
    v-janeyg-msft
    5 years ago

    Hi, kjmts5200 

     

    According to your description, I think you need to create a rank column first, then use it in viusal and visual filter pane to filter top 10, then create a measure to display corresonding symbol names.

    Like this:

    rank = 
    RANKX (
        FILTER ( Table1, [Date] = EARLIER ( Table1[Date] ) ),
        RANKX ( Table1, Table1[Shares],, ASC, SKIP ) * 100
            + RANKX ( Table1, [Symbol],, DESC, SKIP )
    )
    symbol1 = 
    MAXX (
        FILTER (
            ALL ( Table1 ),
            [Date] = SELECTEDVALUE ( Table1[Date] )
                && [rank] = SELECTEDVALUE ( Table1[rank] )
        ),
        [Symbol]
    )

    Here is my sample file. Hope it helps.

    If it doesn’t solve your problem, please feel free to ask me.

     

    Best Regards

    Janey Guo

     

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