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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Find duplicates based when another column has two different values

Hi all

I have accounts that may be duplicated.

I need to see which accounts have both "Y" and "N" in the 'New' column

I'd like a table that have these duplicate Account numbers.

Laganlle_0-1630930789849.png

 

Many thanks for your time!

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Not sure if you need a DAX table or a measure to use in a table visual (or want this done in your query), but here is a DAX table expression that shows one way to do it.  Just replace "Accounts" with your actual table name.

 

YesAndNo =
VAR vSummary =
    SUMMARIZE ( Accounts, Accounts[Account], Accounts[New] )
VAR vResult =
    FILTER (
        DISTINCT ( Accounts[Account] ),
        VAR vThisAccount = Accounts[Account]
        RETURN
            SUMX ( FILTER ( vSummary, Accounts[Account] = vThisAccount )1 ) = 2
    )
RETURN
    vResult

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
mahoneypat
Microsoft Employee
Microsoft Employee

Not sure if you need a DAX table or a measure to use in a table visual (or want this done in your query), but here is a DAX table expression that shows one way to do it.  Just replace "Accounts" with your actual table name.

 

YesAndNo =
VAR vSummary =
    SUMMARIZE ( Accounts, Accounts[Account], Accounts[New] )
VAR vResult =
    FILTER (
        DISTINCT ( Accounts[Account] ),
        VAR vThisAccount = Accounts[Account]
        RETURN
            SUMX ( FILTER ( vSummary, Accounts[Account] = vThisAccount )1 ) = 2
    )
RETURN
    vResult

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Hi

Sorry- just a quick extra question:

How do you add the extra column to the YesAndNo table from the Accounts table? :

Accounts table:

Laganlle_0-1630942613086.png

YesAndNo table:

Laganlle_1-1630942863963.png

Anonymous
Not applicable

Fantastic! That is just what I wanted 🙂

Much appreciated

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors