Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Subtracting cells in two rows with condition

Hi PowerBi Pros!

 

I am wondering if something that i would like to achieve is possible, please look at the picture and read description below:

 

I would like to add a column to the right, where if a cell table[ActionType] = "TERMINATING", it calculates a difference between timestamps (timestamp for TERMINATING - timestamp for STARTING in below row). If the result is positive (>0) then store it in a column in a corresponding row (eg next to timestapm for terminating), if result is negative don't store it. And all of that applied to whole table. 

 

I tried conditional column and i guess it cannot be done with this or at least I couldn't make it. 

 

Will be very thankful for responses and tips!

2 Replies