Forum Discussion
DAX Logical statement and filter logic
Yes, for each order i want to find out if at least one order line is still in "waiting" status which means the order is not completely fulfilled and in this case every order line must be cosiderated as "waiting" in the calculed column while if every order line is fullfilled also the order is fullfilled.
I don't know firstly if is possible create a calculated column with this conditions and as second the relative DAX expression, i try to start with a formula like
If [Status of operation]="shipped", "fullfilled", "waiting" ==> but i don't know how group that with the condition "if at least one order line is still in "waiting" status it means that the order is not completely fulfilled and in this case every order line must be cosiderated as "waiting" in the calculed column while if every order line is fullfilled also the order is "fullfilled".
Really it is a nighmare is you can help me, i really appreciate
Don't despair - nearly there. I made you confirm the business statement to make it easier to see how to translate that into DAX.
For each order, count the rows in "waiting" status. If that count is zero then the order is "fulfilled", otherwise it is not .
Pseudo code for a calculated column
fulfillmentstatus=
var o =selectedvalue(order)
return if(countrows(filter(orderstable,order = o && status="waiting)),"Fulfilled,"waiting")