Forum Discussion

SDSolutions's avatar
SDSolutions
Frequent Visitor
1 year ago
Solved

Dynamic ranking, based on selection

Hello,   I need to generate a visualisation that shows the Selectedvalue and the three neighboring values above and below the current selection. I have hundred of Agents, which are ranked by their ...
  • johnt75's avatar
    1 year ago

    First create a disconnected table containing all the agents, for use in the slicer. You can use something like

    Agents for slicer = DISTINCT( Agents[Agent] )

    Make sure that there is no relationship from this new table to the Agents table.

    Create a measure like

    Agent is visible =
    VAR BaseRank =
        CALCULATE (
            [Rank By Value],
            TREATAS ( VALUES ( 'Agents for slicer'[Agent] ), Agents[Agent] )
        )
    VAR CurrentRank = [Rank By Value]
    VAR Result =
        IF ( CurrentRank >= BaseRank - 3 && CurrentRank <= BaseRank + 3, 1 )
    RETURN
        Result
    

    Add this as a filter to your table / matrix visual, set to show only when the value is 1.