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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Leo_Ha
New Member

How to arrange sum

Hi every one ,

 

I have 2 table like this, 

please help me how to get the result in Actual Qty Column,

For example: item A-A-01 have 2 Plan Qty in Table 1, and in Table 2 actual result of Item A-A-01 is 650

how to calculate Actual Qty column in Table 1 

Leo_Ha_0-1698895875105.png

 

Leo_Ha_1-1698895890956.png

 

 

 

2 REPLIES 2
ThxAlot
Super User
Super User

ThxAlot_0-1701228788784.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Jihwan_Kim_0-1698896634618.png

 

Jihwan_Kim_1-1698896976941.png

 

Actual Qty CC =
VAR _qty =
    RELATED ( 'Table 2'[Qty] )
VAR _cumulateplan =
    SUMX (
        FILTER (
            'Table 1',
            'Table 1'[Item] = EARLIER ( 'Table 1'[Item] )
                && 'Table 1'[Plan] <= EARLIER ( 'Table 1'[Plan] )
        ),
        'Table 1'[Plan Qty]
    )
VAR _prevcumulateplan =
    SUMX (
        FILTER (
            'Table 1',
            'Table 1'[Item] = EARLIER ( 'Table 1'[Item] )
                && 'Table 1'[Plan] < EARLIER ( 'Table 1'[Plan] )
        ),
        'Table 1'[Plan Qty]
    )
RETURN
    IF ( _qty >= _cumulateplan, 'Table 1'[Plan Qty], _qty - _prevcumulateplan )

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors