Search code examples
tableau-desktop

How to create conditional column in Tableau?


I am new to Tableau and realized that Tableau is way different to power-BI. I am struct with this challenge in Tableau. I have data having ID as a column. I want to create a new column Repeated_ID which checks if the IDs in ID column are repeated. If an ID exists more than once in the column, Repeated_ID column should be "Yes" else "No".

This is how my result should look like:

ID Repeated_ID
1     Yes
2     No 
3     No
1     Yes
4     Yes
5     No
4     Yes

Can anyone help me with this?


Solution

  • Create a calculated field : Repeated_ID

    IF COUNT([ID]) > 1
        THEN "Yes"
    ELSE "No"
    END