Forum Discussion
HVAC_Specialist
5 months agoRegular Visitor
Highlight duplicate values in a table
Hello Everybody, I need some help to highlight duplicate values in a table. I tried may offered solutions but I don't get it working, the measures and calculated columns (eg the offered and found sol...
- 5 months ago
Hi HVAC_Specialist ,
Yes, this is now correct. The main difference from your previous result is that the Value column is no longer aggregated, so the duplicate check occurs at the row level as intended. The value 100 is appropriately flagged as a duplicate when it appears multiple times within the current filter context, while other values are not flagged. This matches the expected behavior for a measure-based approach, as it evaluates only the visible rows in the table rather than the entire dataset.
Please find the attached PBIX and Screenshort file for your reference.
Thank you.
Zanqueta
5 months agoSuper User
Measure to detect duplicates within the filtered table:
Duplicate Flag :=
VAR CurrentValue =
SELECTEDVALUE ( 'Table'[Value] )
VAR CountInContext =
CALCULATE (
COUNTROWS ( 'Table' ),
KEEPFILTERS ( 'Table'[Value] = CurrentValue )
)
RETURN
IF ( CountInContext > 1, 1, 0 )
To highlight duplicates:
- Select the column in the table visual.
- Open Cell elements or Conditional formatting.
- Choose Format by: Field value.
- Select the Duplicate Flag measure.
- Define formatting rules for output 1 (duplicate) and 0 (non‑duplicate).
This will highlight duplicates only in the context of the filtered table, which calculated columns cannot achieve
HVAC_Specialist
5 months agoRegular Visitor
The cells are not highlighted, even the measure doesn't show any duplicates. Thanks in advanced