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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors