Forum Discussion
If statement for row difference
- Anonymous6 years ago
HI sheshraja ,
Add an index column in Power Query.
Then Create a Calulated Column
Resultant Column = var prev= CALCULATE(MIN('Table'[A]),FILTER('Table','Table'[Index] = EARLIER('Table'[Index])-1)) RETURN if ('Table'[A] - prev = 1 , 1 , 0)Regards,
Harsh NathaniAppreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution! - 6 years ago
Hi sheshraja ,
You may enter into Query Editor via "Transform data" tab under Home ribbon, add an Index column under "Add column" ribbon, click "Close & Apply" button.
Then you may create calculated column like DAX below.
Result = var _PreRow= CALCULATE(MAX(Table1[A]), FILTER(Table1, Table1[Index]< EARLIER(Table1[Index]))) return IF(Table1[A] =_PreRow, 0, Table1[A] )Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi sheshraja ,
You may enter into Query Editor via "Transform data" tab under Home ribbon, add an Index column under "Add column" ribbon, click "Close & Apply" button.
Then you may create calculated column like DAX below.
Result =
var _PreRow= CALCULATE(MAX(Table1[A]), FILTER(Table1, Table1[Index]< EARLIER(Table1[Index])))
return
IF(Table1[A] =_PreRow, 0, Table1[A] )
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.