Forum Discussion
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
- Ashish_MathurSuper User
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
- WardJRegular Visitor
Thank you Ashish_Mathur that works perfectly :-)
- Ashish_MathurSuper User
You are welcome.