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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
AA622
Helper II
Helper II

Duplicates values within 1 column

Hello

 

I am filtering through a table full of sales orders. Over 100,00 rows. I just want to find the sales order numbers that show up more than once in the column and I want to create a column that tells me if there is, or isn't. True/False if you will. I just need to know which sales order#'s are dupicated so i can sort through them for the different PO #'s. Below is the example of what I am looking for.

 

Agency    order#     PO#       Measure/column

AAA         #230         XY              True

AAA         #230         X                True

AAA         #230         MM            True

BB            #165         L                False

BB            #166          T               False

1 ACCEPTED SOLUTION

Hi @AA622,

You can try to use the following calculate column code, I add conditions to check both two fields to return true/false tags:

Tag =
VAR rowcount =
    COUNTROWS (
        FILTER (
            'Table',
            [Agency] = EARLIER ( 'Table'[Agency] )
                && [Order#] = EARLIER ( 'Table'[Order#] )
        )
    )
RETURN
    IF ( rowcount > 1, TRUE (), FALSE () )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@AA622 ,

new column =

var _cnt = countx(filter(Table, [Order#] =earlier([Order#]) ), [Order #])

return

if(_cnt >1, true(), false())

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hello

 

Thanks so much it works but I have a followup question. I sorted the report to only show the 'True' values but I noticed there are still some order#'s that only show up once yet have the 'true' value. Why is that? I wanted it to show only order#'s that are duplicated within the same column

 

Is there a workaround to this?

Hi @AA622,

You can try to use the following calculate column code, I add conditions to check both two fields to return true/false tags:

Tag =
VAR rowcount =
    COUNTROWS (
        FILTER (
            'Table',
            [Agency] = EARLIER ( 'Table'[Agency] )
                && [Order#] = EARLIER ( 'Table'[Order#] )
        )
    )
RETURN
    IF ( rowcount > 1, TRUE (), FALSE () )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.