Forum Discussion
Anonymized data
- 2 months ago
If your goal is to have the anonymized ranking table and the ±5 bar chart shown in your screenshots, driven by a single slicer on EXENUM. , you can try this solution step by step:
Step 1: Parameter (selected individual)
Create a "What-if" parameter or a disconnected table for the selected PS:
SelectedPS = SELECTEDVALUE('Table'[EXENUM])
Or use a slicer directly on EXENUM.
Step 2: Calculated column for display label
Identifiant Display =
VAR SelectedEXE = SELECTEDVALUE('Table'[EXENUM])
RETURN
IF(
'Table'[EXENUM] = SelectedEXE,
VALUE(FORMAT('Table'[EXENUM], "0")) & " - vous",
"PS anonymisé"
)
Step 3: Écart vs vous measure
Écart vs Vous =
VAR SelectedMNT =
CALCULATE(
MAX('Table'[TOT_MNT]),
FILTER(ALL('Table'), 'Table'[EXENUM] = SELECTEDVALUE('Table'[EXENUM]))
)
VAR CurrentMNT = MAX('Table'[TOT_MNT])
RETURN
IF(
MAX('Table'[EXENUM]) = SELECTEDVALUE('Table'[EXENUM]),
BLANK(),
CurrentMNT - SelectedMNT
)
Step 4: Filter to ±5 ranks (for the bar chart)
IsInScope_±5 =
VAR SelectedRank =
CALCULATE(
MAX('Table'[RG_MNT]),
FILTER(ALL('Table'), 'Table'[EXENUM] = SELECTEDVALUE('Table'[EXENUM]))
)
RETURN
ABS('Table'[RG_MNT] - SelectedRank) <= 5
Use this as a visual-level filter (IsInScope_±5 = TRUE) on both the table and the bar chart.
Step 5: Conditional formatting (gold color for "vous")
Create a measure for bar color:
Bar Color =
IF(
MAX('Table'[EXENUM]) = SELECTEDVALUE('Table'[EXENUM]),
"#F0B429", -- gold
"#3B6FC4" -- blue
)
Apply it in the bar chart → Columns → fx → Field value → Bar Color.
Table visual setup:
Column | Value
RANG | RG_MNT
IDENTIFIANT | Identifiant Display
TOT_MNT | TOT_MNT
ÉCART VS VOUS | Écart vs Vous
Finally, you sort by RG_MNT ascending. Add conditional formatting on Écart vs Vous: positive = green, negative = red.
You can achieve this with a DAX rank measure and anonymized labels. Show the selected person's details, replace other names with generic labels (e.g., Participant 1, Participant 2), and use a table or bar chart to display ranks while preserving privacy. 👍