Forum Discussion
Anonymous
6 years agoNot applicable
Custom column
Hi, so I have two columns depth from and depth to. I need to create a new column called Total depth that: - has the first row the same as in depth from (30 in this case) - the rest of rows are copi...
Tahreem24
6 years agoSuper User
Anonymous ,
Follow the below steps:
Step 1: create index column from Power Query. Go to Power Query editor --> Select any column on which you want to create index lets say "DateColumn" --> Go to Add Column menu --> click on Index Column --> Save and apply.
Step 2: Create below DAX Column:
Column =
Var a = CALCULATE(MAX(Sheet6[Value2]),FILTER((Sheet6),Sheet6[Index]=EARLIER(Sheet6[Index])-1))
RETURN IF(a=BLANK(),CALCULATE(SUM(Sheet6[Value]),Sheet6[Index]=0),a)
See the below Screen shot:
Tahreem24
6 years agoSuper User
So directly use the calculated column like below:
Column =
Var a = CALCULATE(MAX(Sheet6[Value2]),FILTER((Sheet6),Sheet6[StepNo]=EARLIER(Sheet6[StepNo])-1))
RETURN IF(a=BLANK(),CALCULATE(SUM(Sheet6[Value]),Sheet6[StepNo]=1), a)