Forum Discussion
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
https://www.dropbox.com/s/4pbc79tpo9yg59a/help.pbix?dl=0
Any help will be greatful
Cheers,
Mike
michael_knight , Create a new column like
if([created on] = minx(filter(Table, [email] = earlier([email])), [created on]), "Yes", blank())
2 Replies
- amitchandakSuper User
michael_knight , Create a new column like
if([created on] = minx(filter(Table, [email] = earlier([email])), [created on]), "Yes", blank())
- v-kelly-msftCommunity 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:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!