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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PaulCo
Helper II
Helper II

Identify the earliest entry in a set of duplicates

Hi There

 

I am trying to add a column to a set of data which would identify the earliest entry based on a date field.

 

I have an excel spreadsheet with data that contains duplicate entries from the same customer which all have a field for when they were registered and I want to highlight the line which is the earliest entry and mark it with a column of True/False or somthing similar.

 

Example:

 

CustomerDate RegisteredEarliest Record
A6/30/2016FALSE
A5/30/2016FALSE
A1/30/2016TRUE
B2/3/2017TRUE
B8/8/2017FALSE
A5/28/2016FALSE

 

In Excel I would use the MINISF function with some aditional columns to work it out but how would I acomplish this in Power BI?

 

Thanks

Paul

1 ACCEPTED SOLUTION
KHorseman
Community Champion
Community Champion

Create a new column:

 

Earliest Record = IF(
    TableName[Date Registered] = CALCULATE(
        MIN(TableName[Date Registered]),
        ALLEXCEPT(TableName, TableName[Customer])
    ),
    TRUE,
    FALSE
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

=CALCULATE(MIN([Date Registered]),FILTER(data,data[Customer]=EARLIER(data[Customer])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
KHorseman
Community Champion
Community Champion

Create a new column:

 

Earliest Record = IF(
    TableName[Date Registered] = CALCULATE(
        MIN(TableName[Date Registered]),
        ALLEXCEPT(TableName, TableName[Customer])
    ),
    TRUE,
    FALSE
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Worked perfectly, thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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