Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

How to calculate duplicates with exceptions

Hi Community,

i have create this formula to calculate the ducpliates in a list:

Exampel = VAR varCurrentValue = 'Elements'[Description]
VAR varInstances =
    COUNTROWS(
        FILTER(
            'Elements',
            'Elements'[Description] = varCurrentValue
        )
    )
var Result =
    IF(
        varInstances > 1,
        "No",
        "Yes"
    )
RETURN
    Result
 
however i would need to exclude some exception in the list for example : house, car and table
 
Can you help me with this??

4 Replies

  • hello,

    you could add a var at first to specify the the elemets like element <> "car" && element <> "Table" && element <> "house"

     

    If I answered your question, please mark my post as solution so it would appeare to others, Appreciate your Kudos👍

    Follow me on Linkedin

    • Anonymous's avatar
      Anonymous
      Not applicable

      Can you add an example? 
      I do not understand your response


      Regards

  • hi   Anonymous 

    try like:

    Exampel = 
    VAR varCurrentValue = 'Elements'[Description]
    VAR varInstances =
        COUNTROWS(
            FILTER(
                'Elements',
                'Elements'[Description] = varCurrentValue
            )
        )
    var Result =
    IF(
        NOT varCurrentValue in {"house", "car", "table"},
        IF(
            varInstances > 1,
            "No",
            "Yes"
        ), "No"
    )
    RETURN
        Result
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks,

      I forgot to say that that valus must "contain" as i will have many Houses ( house 1, House 3, House 19...)