cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

Solved

Thanks_solved

1 REPLY 1
v-rzhou-msft
Community Support
Community Support

Hi @Anonymous ,

 

I can get result in table1 by calcualted column.

Return_Final Packaging = 
SWITCH (
    TRUE (),
    'Table'[Order Qty] = 'Table'[InTransit], 0,
    'Table'[Order Qty] = 'Table'[Return_Final Shipped Qty], 0,
    'Table'[InTransit] = 0
        && 'Table'[Pre_Packaging Qty] = 0, 0,
    'Table'[Return_Final Shipped Qty] + 'Table'[InTransit] = 'Table'[Order Qty], 0,
    'Table'[Return_Final Shipped Qty] + 'Table'[InTransit] + 'Table'[Pre_Packaging Qty] <= 'Table'[Order Qty], 'Table'[Pre_Packaging Qty],
    'Table'[Return_Final Shipped Qty] + 'Table'[InTransit] + 'Table'[Pre_Packaging Qty] > 'Table'[Order Qty],
        'Table'[InTransit] - 'Table'[Return_Final Shipped Qty] - 'Table'[Pre_Packaging Qty] - 'Table'[Order Qty]
)
Return_Final Shipped Qty = 
SWITCH (
    TRUE (),
    'Table'[Order Qty] = 'Table'[InTransit], 0,
    'Table'[InTransit] = 0
        && 'Table'[Pre_shipped] = 0, 0,
    'Table'[Pre_shipped] + 'Table'[InTransit] <= 'Table'[Order Qty], 'Table'[Pre_shipped],
    'Table'[Pre_shipped] + 'Table'[InTransit] > 'Table'[Order Qty], 'Table'[Order Qty] - 'Table'[InTransit]
)
Return_OPEN column = 
IF (
    'Table'[InTransit] + 'Table'[Return_Final Shipped Qty] + 'Table'[Return_Final Packaging] <= 'Table'[Order Qty],
    'Table'[Order Qty] - ( 'Table'[InTransit] + 'Table'[Return_Final Shipped Qty] + 'Table'[Return_Final Packaging] )
)

RicoZhou_1-1653296090840.png

I am confused about why all values in column1 are shown as only Cat and Peacock? I think there should be six kinds of different categorys in column1. And what is the calculate logic to get [Running total] and [Per_Shipping_QTY] in table2? Why [Running total] and [Per_Shipping_QTY] for Cat return 1 and [Running total] and [Per_Shipping_QTY] for Peacock return 10,7,2? To get previous shipped qty, I think you need to add an Index column for each category to determind the value order.

RicoZhou_0-1653295904966.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors