Answer
Please see the sample packaged workbook found in the Attachments section of the article to follow along with the following steps.
1. Create a calculation field Accumulated Row to merge string values of previous rows until the current row into one string.
IF FIRST()=0 THEN LOOKUP(MIN([Item]),0)
ELSE
PREVIOUS_VALUE(MIN([Item]))+LOOKUP(MIN([Item]),0)
END
2. Add Accumulated Row to the Rows shelf and set the table calculation direction as below.
3. Create a calculation field Accumulated Row(Exclude current row) to remove the string value of the current row only from Accumulated Row.
LEFT([Accumulated Row],INDEX()-1)
4. Add Accumulated Row(Exclude current row) to the Rows shelf and set the table calculation direction as below.
5. Create a calculation field Dup-Flag to mark the duplication row as "Duplicate Row" .
IF CONTAINS([Accumulated Row(Exclude current row)],LOOKUP(MIN([Item]),0))
THEN "Duplicate Row"
ELSE ""
END
6. Add the Dup-Flag to the Rows shelf and set the table calculation direction as below.
7. Add the same Dup-Flag to Color Marks card to color the row.
Check the results.