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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
ScottieLobster
Frequent Visitor

Identifying duplicate IDs based on values against one or more ID

Hello, 

 

I started using Power BI appox. 3 months ago on a "pushing buttons until it works" basis. 

 

I want to produce a column or table that shows only those client IDs that have never had a "Yes" value returned by a calculated column. The calculated column is based on whether a client has made an order before a particular date. 

 

Here is some example data:

 

ID number

Name

Yes or No (on or before 02/10/2017)

Order Date

1234

Mickey Mouse

Yes

02/10/2107

1234

Mickey Mouse

No

03/11/2017

5678

Jon Snow

Yes

01/01/2016

5678

Jon Snow

Yes

03/06/2017

5678

Jon Snow

No

01/11/2017

9876

Smurfette

Yes

01/09/2017

9876

Smurfette

No

01/12/2017

1920

Skeletor

Yes

01/08/2017

1920

Skeletor

No

01/01/2018

1920

Skeletor

No

01/06/2018

1920

Skeletor

No

01/02/2019

5647

Invader Zim

No

01/12/2018

5647

Invader Zim

No

01/06/2019

5647

Invader Zim

No

01/01/2019

 

In essence, I want to return only Invader Zim or put a "True/False" value only on Invader Zim, as everyone else has made an order before 02/102/2017 except him. 

 

I have one table (table1) with all orders made by all clients and another table (table2) with only orders made before 02/10/2017. I have also made a distinct value of all client IDs to relate these two tables together but that doesn't seem to have helped. If I try to use a "CONTAINS" function to exclude those IDs in table1, I get a circular error. 

 

Help me, Power BI Community - you're my only hope. 

 

Best, 

Lobster

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @ScottieLobster 

 

You can add a column like below, it will return True if "Yes" and False if "No".

Column = 
CALCULATE( 
    COUNTROWS( 'Table' ), 
    ALLEXCEPT( 'Table', 'Table'[ID number] ),
    'Table'[Yes or No (on or before 02/10/2017)] = "Yes"
) > 0
Hope this helps!
 
Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

View solution in original post

3 REPLIES 3
Mariusz
Community Champion
Community Champion

Hi @ScottieLobster 

 

You can add a column like below, it will return True if "Yes" and False if "No".

Column = 
CALCULATE( 
    COUNTROWS( 'Table' ), 
    ALLEXCEPT( 'Table', 'Table'[ID number] ),
    'Table'[Yes or No (on or before 02/10/2017)] = "Yes"
) > 0
Hope this helps!
 
Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

This made my day.  It works!

 

THANK YOU!

Hi @ScottieLobster 

Always happy to help!

 

Best Regards,
Mariusz

Please feel free to connect with me.
Mariusz Repczynski

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.