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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
abrasington
Regular Visitor

Flagging duplicate fields

Hi all,

 

I have a table with every row describing a single quantity of different types of equipment.

Some rows are meant to have a unique item ID code, and I would like to first display all rows of only a certain type of equipment and then make sure that each row of said equipment isn't duplicating any item ID codes. 

 

I'm playing around with using DISTINCT, but so far no luck. Any good ideas of how to tackle this?

 

Thanks

1 ACCEPTED SOLUTION
v-xjiin-msft
Solution Sage
Solution Sage

Hi @abrasington,

 

In your scenario, did you mean this?

 

We can create a calculated column to count the number of ItemID based on equipment type group. And if the number is more than 1, obviously there exists duplicate item id.

 

Count ItemID =
CALCULATE (
    COUNT ( equipment[ItemID] ),
    ALLEXCEPT ( equipment, equipment[equipment] )
)

4.PNG

 

And if you want to check a certain type of equipment. You can do this:

 

Count A1 =
CALCULATE (
    COUNT ( equipment[ItemID] ),
    FILTER ( equipment, equipment[equipment] = "A1" )
)

Thanks,
Xi Jin.

View solution in original post

2 REPLIES 2
v-xjiin-msft
Solution Sage
Solution Sage

Hi @abrasington,

 

In your scenario, did you mean this?

 

We can create a calculated column to count the number of ItemID based on equipment type group. And if the number is more than 1, obviously there exists duplicate item id.

 

Count ItemID =
CALCULATE (
    COUNT ( equipment[ItemID] ),
    ALLEXCEPT ( equipment, equipment[equipment] )
)

4.PNG

 

And if you want to check a certain type of equipment. You can do this:

 

Count A1 =
CALCULATE (
    COUNT ( equipment[ItemID] ),
    FILTER ( equipment, equipment[equipment] = "A1" )
)

Thanks,
Xi Jin.

Anonymous
Not applicable

My immediate thought is you could create a calculated column that does a count of each row and how often a particular field appears. You could then filter on that number.

 

Something like 

AppearCount = VAR searchStr = [YourField]
RETURN
Calculate(
         COUNTROWS('MyTable'),
         'MyTable'[YourField] = searchStr
)

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.