Forum Discussion
SDSolutions
1 year agoFrequent Visitor
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 ...
- 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 ResultAdd this as a filter to your table / matrix visual, set to show only when the value is 1.
johnt75
1 year agoSuper User
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.
SDSolutions
1 year agoFrequent Visitor
Thanks. That works as needed.