cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
WardJ Frequent Visitor
Frequent Visitor

add column based on another column

I've serarched for an answer to this but being new to Power BI i've really struggled to try find a solution I can translate to my own needs.

 

I have a table with a list of ID's and date of entry:

 

Screen Shot 2019-02-16 at 3.21.18 pm.pngSource Data

 

I am trying to add a column showing the order they entered like this:

Screen Shot 2019-02-16 at 3.23.54 pm.pngOutput Data

 

Any assistance will be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: add column based on another column

Hi,

 

Try this calculated column formula

 

=CALCULATE(COUNTROWS(Data),FILTER(Data,Data[ID]=EARLIER(Data[ID])&&Data[Date Entered]<=EARLIER(Data[Date Entered])))

 

The result should be 1,1,2,3,2,4,1

 

Untitled.png

3 REPLIES 3
Super User
Super User

Re: add column based on another column

Hi,

 

Try this calculated column formula

 

=CALCULATE(COUNTROWS(Data),FILTER(Data,Data[ID]=EARLIER(Data[ID])&&Data[Date Entered]<=EARLIER(Data[Date Entered])))

 

The result should be 1,1,2,3,2,4,1

 

Untitled.png

WardJ Frequent Visitor
Frequent Visitor

Re: add column based on another column

Thank you @Ashish_Mathur that works perfectly :-)

Super User
Super User

Re: add column based on another column

You are welcome.