Forum Discussion
Find the previous action
Hi MathieuF ,
It seems that the key [action] field is missing from the data.
Please try:
Column =
VAR _close_time = CALCULATE(MAX('Table'[created_at]),'Table'[action]="auto-close",ALLEXCEPT('Table','Table'[ID]))
VAR _result =IF('Table'[created_at]=CALCULATE(MAX('Table'[created_at]),'Table'[created_at]<_close_time,ALLEXCEPT('Table','Table'[ID])),1)
RETURN
_result
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Anonymous
Thank you for your help, unfortunately, I have an error message:
It is not possible to determine a unique value for the "created_at" column of the "Journal" table. This can happen when a measure formula refers to a column that contains many values, without specifying an aggregation such as min, max, count, or sum to get a single result.
So I changed the query to
Auto-close =
VAR _close_time = CALCULATE(MAX('Journal'[created_at]),'Journal'[action]="auto-close",ALLEXCEPT('Journal','Journal'[id]))
VAR _result =IF(MAX('journal'[created_at])=CALCULATE(MAX('Journal'[created_at]),'Journal'[created_at]<_close_time,ALLEXCEPT('Journal','Journal'[id])),1)
RETURN
_result
is it good ?
Because I have no result 😞