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
Slipper
Frequent Visitor

Pro rata split of products applied to BOM weights

Hello together,

 

I have a problem in applying a pro rata % split to weights of another table.

 

I have a BOM table of production of different material types from various input components.

I have a table with data from a production line which uses the material types, processing them and allocating them to product group and therefore to a sales stream/value stream.

As there is no physicial traceability, I want to use the % split of the destribution on product category based on the output weights to calculate how much of each input component per material type went into which product category & value stream.

The only relationships between both tables are the date/month and the material type, both filtered by a master table.

 

The desired outcome is then the distribution of the input component weights over the product group which I can summarize for the value streams and filter over time, material type, so it should be dynamic and I would like to use the summed tonnages for further calculations, like % of input compenent x over time in product group y etc.

 

In addition I have an external source "code 200" which should not be considered but that's the second priority.

 

I tried multiple things using ALL & ALLEXCEPT but I can't get it to work, as the filtering produces incorrect calculation while others doesn't work at all.

 

This is how I tried to do the % splits in the last try:

 

----

Percentage split =
Var one =
CALCULATE( SUM(Table1[Output weight] ), ALLEXCEPT( 'Table1' , Table1[Material type] ))

VAR two =
CALCULATE( SUM( Table1[Output weight] ), ALLEXCEPT( 'Table1' , Table1[Material type] , Table1[Product category] ))

Return
two / one

If someone can point me into the right direction or already knows how to accomplish would be great,

any help much appreciated, thanks in advance!

 

BR

Slipper

-----

 

Structure:

 

Slipper_1-1622703410285.png

 

Slipper_2-1622704465175.png

 

Tables:

MonthInput weightOutput weightSource codeMaterialValue streamProduct group
Jan-2160005000100A1X
Jan-2145004300200A2Y
Jan-2142004100100B1G
Jan-2165006400200B2H
Jan-2188008700200B2J
Feb-211210011000200C2t
Feb-211340013300200A2f
Feb-211770015600100B1n
Feb-211800017900300A2o
Feb-212130020200200C3t
Feb-212260022500100A2p

 

MonthMaterialInput componentInput weight
Jan-21Ax5000
Jan-21Ay10000
Jan-21Az7500
Jan-21At8000
Jan-21Bx7600
Jan-21By4500
Jan-21Br3700
Jan-21Bv870
Feb-21Ay4300
Feb-21Az2000
Feb-21At6500
Feb-21Cv6700
Feb-21Cy1900
Feb-21Cz2300
1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @Slipper ,

 

You can try this formula

Percentage split =
VAR one =
    CALCULATE (
        SUM ( Table1[Output weight] ),
        FILTER (
            ALLSELECTED ( 'Table1' ),
            [Material type] = MAX ( Table1[Material type] )
        )
    )
VAR two =
    CALCULATE (
        SUM ( Table1[Output weight] ),
        FILTER (
            ALLSELECTED ( 'Table1' ),
            [Material type] = MAX ( Table1[Material type] )
                && [Product category] = MAX ( Table1[Product category] )
        )
    )
RETURN
    two / one

 

 

 

Best Regards,

Stephen Tao

 

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

View solution in original post

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @Slipper ,

 

You can try this formula

Percentage split =
VAR one =
    CALCULATE (
        SUM ( Table1[Output weight] ),
        FILTER (
            ALLSELECTED ( 'Table1' ),
            [Material type] = MAX ( Table1[Material type] )
        )
    )
VAR two =
    CALCULATE (
        SUM ( Table1[Output weight] ),
        FILTER (
            ALLSELECTED ( 'Table1' ),
            [Material type] = MAX ( Table1[Material type] )
                && [Product category] = MAX ( Table1[Product category] )
        )
    )
RETURN
    two / one

 

 

 

Best Regards,

Stephen Tao

 

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

@v-stephen-msft 

 

Thanks! Worked as intended and I managed to modify it including the other splits I needed.

 

Best regrads,

Slipper

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.