Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
ianneg77
Frequent Visitor

Order status, based on parts availability

I need help on this one. I am working on a project with my shipping folks. I need to be able to show if an order is complete, based on the lowest common result.

 

For example, I have an order made up of 3 different parts, each individual part has a stock status, "OK" or "short". If all of the parts in the order have a stock status as OK, the order can be marked as "complete". If any of the 3 parts in the order are "short", the order status needs to be marked as "not complete". I repeat the order needs to be marked "not complete", not the item line. I already have a field I calculate the the correct status for the item line. When I have an order with lots of parts each with their own stock status I can't get it to work correctly.  See screen shot:

 

This order needs to be marked "NO" in "Order Complete" column since 1 of the 4 items is short, even though the other 3 are "OK". Can't ship until all items are "OK" then order can be marked as complete. HELP!

 

Capture BI.JPG

 

2 ACCEPTED SOLUTIONS
v-frfei-msft
Community Support
Community Support

Hi @ianneg77,

 

I made one sample for your reference. If the sample data cannot meet your requirement, kindly share your sample data to me.

 

Measure = var result =CALCULATE(MAX(Table1[RESULT]),ALLEXCEPT(Table1,Table1[or-no]))
return 
IF(result="Short","not complete","complete")

Capture.PNG

For more details, please check the pbix as attached.

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

This is great, worked the way i needed it to. Thanks to you and the other folks who contributed potential solutions. This worked with what I was trying to do best. This community is indispensable.

View solution in original post

4 REPLIES 4
v-frfei-msft
Community Support
Community Support

Hi @ianneg77,

 

I made one sample for your reference. If the sample data cannot meet your requirement, kindly share your sample data to me.

 

Measure = var result =CALCULATE(MAX(Table1[RESULT]),ALLEXCEPT(Table1,Table1[or-no]))
return 
IF(result="Short","not complete","complete")

Capture.PNG

For more details, please check the pbix as attached.

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

This is great, worked the way i needed it to. Thanks to you and the other folks who contributed potential solutions. This worked with what I was trying to do best. This community is indispensable.

dedelman_clng
Community Champion
Community Champion

You should be able to do something along the lines of

 

IsComplete = IF ( MAXX(Parts, Parts[StockStatus]) = "OK", TRUE(), FALSE() )

Hope this helps

David

 

ETA: You should consider moving the order status field outside of the detail area (to the order, rather than the part) of the visual so there is only one value.

Minseven
Helper I
Helper I

just an idea:

why not create another table, add conditionnal column "If short = 1 else 0" then group by Order number and aggregate by taking the MAX of your conditional column.

Now go back to your order table and Merge (Many to one) and expand the previously created conditionnal column

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.