Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

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 4
FreemanZ
Super User
Super User

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
Not applicable

Thanks,

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

Idrissshatila
Super User
Super User

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Anonymous
Not applicable

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


Regards

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.