Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Need help on this Formula

I been using PowerBI for awhile and I got stuck on this logic.

 

So basically i have two tables.

 

Table 1

ItemRequirement
A200
B150
V150
D200
G350
H69

 

Table 2

Qty
100
222
150
100
58
44

 

 

The goal is to sum Table 2 - which is 674 (sum of qty)

Then distribute those to Table 1 base on requirements from top to bottom.

 

so you see that item A got 200, Item B got 150 and so on, but on Item D it should only use 174 because the total QTY of table two is 674.

 

here's the desired outcome. the sum from answer column is 674 which should match the table 2 sum.

 

 

2 Replies

  • camargos88's avatar
    camargos88
    Community Champion

    Hi Anonymous ,

     

    Check this file: Download PBIX 

     

    If you consider it as a solution, please mark as a solution and kudos.

    Ricardo

  • az38's avatar
    az38
    Community Champion

    Hi Anonymous 

    How do you plan to rank values in your Table1? If it's alphabetic ranking, why V before D? If not - whats rule do define that A is first, B is second?