Forum Discussion
stsdrillingeng3
2 years agoFrequent Visitor
Offset column with a date
Hello everybody, here is my problem : I'm trying to offset a column so that i can have the time between operations (in powerbi dax) the thing is that i can do it with numbers but i dont know...
- 2 years ago
Hi stsdrillingeng3 possible solution is calculated column as below. Adjust Sheet1 to your table name.
This solution assumes that column ID is unique value to identify row for end date.
Offset formula =VAR __current_id=Sheet1[id]RETURNCALCULATE(MAX(Sheet1[end_date]),FILTER(Sheet1,Sheet1[id]=__current_id-1))OutputDid I answer correctly? Kudos appreciate / accept solution.
some_bih
Community Champion
2 years agoHi stsdrillingeng3 possible solution is calculated column as below. Adjust Sheet1 to your table name.
This solution assumes that column ID is unique value to identify row for end date.
Offset formula =
VAR __current_id=Sheet1[id]
RETURN
CALCULATE(
MAX(Sheet1[end_date]),
FILTER(Sheet1,
Sheet1[id]=__current_id-1)
)
Output
Did I answer correctly? Kudos appreciate / accept solution.
- stsdrillingeng32 years agoFrequent Visitor
Yeas it works perfectly thanks a lot ! I tried using the offset formula but yours is so much more easier and comprehensible.