Forum Discussion
gv
8 years agoNew Member
Create Custom Column by using data from previous row
I am currently creating a CustomColumn in a existing model where I need to use data from previous rows to calucate the column value. This is already existing in Excel which I am currently migrating i...
- 8 years ago
Hi,
This calculated column formula seems to work
=if(CALCULATE(SUM(Data[Dependency]),FILTER(Data,Data[ID]>=EARLIER(Data[ID])-2&&Data[ID]<=EARLIER(Data[ID])))>=2,Data[TestResult],BLANK())
Hope this helps.
- 8 years ago
Hi,
You have to go to Modelling > Add column and paste the query there.
Ashish_Mathur
8 years agoSuper User
Hi,
This calculated column formula seems to work
=if(CALCULATE(SUM(Data[Dependency]),FILTER(Data,Data[ID]>=EARLIER(Data[ID])-2&&Data[ID]<=EARLIER(Data[ID])))>=2,Data[TestResult],BLANK())
Hope this helps.
gv
8 years agoNew Member
I am creating this model in PowerBI Desktop and can you help to write the same query accepted by PowerBI Desktop. I have trouble executing the query
- Ashish_Mathur8 years agoSuper User
Hi,
You have to go to Modelling > Add column and paste the query there.