Forum Discussion

WardJ's avatar
WardJ
Regular Visitor
7 years ago
Solved

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:

 

Source Data

 

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

Output Data

 

Any assistance will be greatly appreciated.

  • 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

     

3 Replies

  • 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