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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
John_freemont
Frequent Visitor

Calculation of total product qty shipped by location percentage

Hi,

 

Hoping someone can help.

 

I'm getting stumped on this one, where I'm trying to assign product quantity shipped to the quantity from location. i.e each product has a different percentage of it made from different locations and I need to be able to show the total quantity shipped by location produced.

 

I've included an exemplar PBIX (http://www.filedropper.com/calculationissueexample ) with synthetic data in it and is a small subset of the total model I've inherited, so changes to the model aren't really an option. The only difference my syntehtic data doesn't show is the 1 to 1 relationships you'll see are really 1 to many in the real model (Calendar -> Shipment Detail and Shipment -> Shipment Detail).

 

The outcome should look like this and also be able to be filtered by a Year context:

 

LocationTotal Qty
A6148.5
B1892.5
C6809

 

The calculation needs to happen at a row level between Product Content.Percentage_of_Product and Shipment Item.Qty. An exemplar theroteical table to create what I am after is below, it isn't a table that is in the actual model and I can't quite firgure how to bring it together for the calculation I need.

 

Product_IDProduct Content.Percentage_of_ProductProduct Content.Location Shipment Item.Qty Product Content.Percentage_of_Product * Shipment Item.Qty
120A53001060
130B53001590
150C53002650
298A32003136
22C320064
3100C36003600
4 A12000
571A27501952.5
518C2750495
511B2750302.5

 

Thanks.

 

 

1 ACCEPTED SOLUTION
John_freemont
Frequent Visitor

Alright. Managed to figure it out.

 

Here's my resolution

 

 

Measure =
SUMX (
    SUMMARIZE (
        'Product Content',
        'Product Content'[Product_ID],
        'Product Content'[Percentage_of_Product],
        "calc", SUM ( 'Shipment Item'[Qty] )
            * FIRSTNONBLANK ( 'Product Content'[Percentage_of_Product], 1 ) / 100
    ),
    [calc]
)

 

 

View solution in original post

1 REPLY 1
John_freemont
Frequent Visitor

Alright. Managed to figure it out.

 

Here's my resolution

 

 

Measure =
SUMX (
    SUMMARIZE (
        'Product Content',
        'Product Content'[Product_ID],
        'Product Content'[Percentage_of_Product],
        "calc", SUM ( 'Shipment Item'[Qty] )
            * FIRSTNONBLANK ( 'Product Content'[Percentage_of_Product], 1 ) / 100
    ),
    [calc]
)

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (1,866)