Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All
I need to show the delivery completion status for orders.
Each Order has 1 or more orderlines with same order number, like this
Order no | 'order'[supplier_skey] | orderd quantity | recived quantity |
1 | 1 | 2 | 2 |
1 | 1 | 2 | 2 |
2 | 2 | 2 | 2 |
2 | 2 | 2 | 1 |
3 | 3 | 2 | 0 |
3 | 3 | 2 | 0 |
What I´m after is to build a messure called "delivery completion status" that I can add to a table like this with resulte as below.
Order no | 'supplier'[name] | Sum(orderd quantity) | Sum(recived quantity) | Delivery Completion Status |
1 | ada | 4 | 4 | YES |
2 | bob | 4 | 3 | PARTIALLY |
3 | cid | 4 | 0 | NO |
YES is true if (orderd quantity=recived quantity)
NO is true if (orderd quantity=0)
PARTIALLY is true if (orderd quantity>0 AND orderd quantity<recived quantity)
EMPTY is else
I´ve built this Messure:
Aditro order completed =
VAR Orderd =
SUM ( 'Order'[orderd quantity] )
VAR Recived =
SUM ( 'Order'[recived quantity] )
RETURN
CALCULATE (
SWITCH (
TRUE (),
Orderd = Recived , "YES",
Orderd = 0, "NO",
Orderd < Recived
&& Orderd > 0, "PARTIALLY",
"EMPTY"
),
'Order'[company] = 1,
'Order'[Route] = "west"
)
(I also need to filter in company and route but I don´t think that is an issue here)
My result is this:
Order no | 'Supplier'[name] | Sum(orderd quantity) | Sum(recived quantity) | Delivery Completion Status |
1 | ada | 2 | 2 | YES |
1 | ada | 2 | 2 | YES |
2 | bob | 2 | 2 | YES |
2 | bob | 2 | 1 | PARTIALLY |
3 | cid | 2 | 0 | NO |
3 | cid | 2 | 0 | NO |
Solved! Go to Solution.
Ok there is a stupid guy infront of this computer that forgot to check filtering directons in the model. Solved it with a lookup.
Sorry for bothering you guys with this nonsens
Måns
Ok there is a stupid guy infront of this computer that forgot to check filtering directons in the model. Solved it with a lookup.
Sorry for bothering you guys with this nonsens
Måns
Hi @MansRydell ,
It turned out to be for this reason. If your question is resolved, you can mark the correct response as a standard answer to help the other members find it more quickly.😁
Best Regards,
Henry
hi @MansRydell ,
Try creating following 3 measures as mentioned below.
Hi @MansRydell ,
At this stage, it is impossible to conduct further tests based on the information you provided. Whether it is possible to provide relevant data models (delete sensitive information) and clear needs, I will answer for you as soon as possible.
Best Regards,
Henry
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |