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
michael_knight
Post Prodigy
Post Prodigy

Distinct Count displaying earliest

Hi,

 

I want to create a column which displays the earliest occurance of a record. I've made a small sample data below of what it should look like. I created it on Excel and it's the First column which I want to recreate in Power BI 

help2.PNG

 

https://www.dropbox.com/s/4pbc79tpo9yg59a/help.pbix?dl=0

 

Any help will be greatful

 

Cheers,

Mike

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@michael_knight , Create a new column like

if([created on] = minx(filter(Table, [email] = earlier([email])), [created on]), "Yes", blank())

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi  @michael_knight ,

 

Create a new column as below:

Column = 
var _earliestdate=CALCULATE(MIN('Sheet1'[CreatedOn]),FILTER('Sheet1','Sheet1'[Email]=EARLIER(Sheet1[Email])))
Return
IF('Sheet1'[CreatedOn]=_earliestdate,"Yes",BLANK()) 

Or a measure as below:

Measure = 
var _earliestdate=CALCULATE(MIN('Sheet1'[CreatedOn]),FILTER(ALL('Sheet1'),'Sheet1'[Email]=MAX(Sheet1[Email])))
Return
IF(MAX('Sheet1'[CreatedOn])=_earliestdate,"Yes",BLANK()) 

And you will see:

v-kelly-msft_0-1610530980291.png

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

amitchandak
Super User
Super User

@michael_knight , Create a new column like

if([created on] = minx(filter(Table, [email] = earlier([email])), [created on]), "Yes", blank())

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.