Forum Discussion
joshua1990
Post Prodigy
4 years agoCalculated Column - Last Entry per Sales Order
Hi experts! I have a table that shows me the value for each sales order for the respective state: Order Number Status Value 100 50 5 100 66 5 100 80 4 100 95 101 50 ...
- 4 years ago
Hi joshua1990
Try the below codeNullValueFill = Var _Status = 'Table'[Status] Var _Value ='Table'[Value] Var _PreviousStatus = maxx(filter('Table','Table'[Status]<_Status),'Table'[Status]) Var _PreviousValue = CALCULATE(Max('Table'[Value]),filter('Table','Table'[Status]=_PreviousStatus)) Var result = If(isblank(_Value),_PreviousValue,_Value) Return resultIf there is any issue please reply.
If this post helps, then please consider accepting it as the solution to help the other members find it more quickly.
Regards,
Atma.
Dhacd
Resolver III
4 years agoHi joshua1990,
Just to check whether we are on the same page,
In this context you want the blank row to have the value of previous number status but same order id
That is 4.
If this is what you are trying to achieve it is possible.
Reply whether I understood your problem correctly or not.
Regards,
Atma.
- joshua19904 years ago
Post Prodigy
Dhacd : Exactly!
- Dhacd4 years ago
Resolver III
Hi joshua1990
Try the below codeNullValueFill = Var _Status = 'Table'[Status] Var _Value ='Table'[Value] Var _PreviousStatus = maxx(filter('Table','Table'[Status]<_Status),'Table'[Status]) Var _PreviousValue = CALCULATE(Max('Table'[Value]),filter('Table','Table'[Status]=_PreviousStatus)) Var result = If(isblank(_Value),_PreviousValue,_Value) Return resultIf there is any issue please reply.
If this post helps, then please consider accepting it as the solution to help the other members find it more quickly.
Regards,
Atma.