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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
mnb_dk
Helper I
Helper I

Add TOTAL column within table

Hi

I have a table and would like to add a total column as a column in between the values.

All values needs to be summarized except colum with value 2220. 

 

See screenshot below. All values from column 1110, 1111, 1112, 1120, 1121, 1140, 1141, 1142 needs to be summarized in a new column called TOTAL (yellow). 

 

I have made a new column which summarizes the values, but when I insert this new calculated column it is not shown in the table header.

 

PBI.png

1 ACCEPTED SOLUTION

@mnb_dk 
please follow the power query transformation details in the sample file.

1.png2.png4.png3.png

Total Amount = 
SUMX ( 
    VALUES ( G_L_Amount_Numbers[Account] ),
    IF ( 
        G_L_Amount_Numbers[Account] = "Total",
        CALCULATE ( 
            SUM ( 'Table'[Amount] ), 
            G_L_Amount_Numbers[Account] <> "2220", 
            ALL ( G_L_Amount_Numbers[Index] ) 
        ),
        SUM ( 'Table'[Amount] )
    )
)

 

View solution in original post

7 REPLIES 7
mnb_dk
Helper I
Helper I

The data is sensitive 😞

This is how the table is set up:
PBI1.png

@mnb_dk 
Difficult to guess without sample data but could it be something like this?

1.png

Total Amount = 
SUMX ( 
    VALUES ( G_L_Amount_Numbers[G_L_Amount_No] ),
    IF ( 
        G_L_Amount_Numbers[G_L_Amount_No] = "Total",
        CALCULATE ( 
            SUM ( 'Table'[Amount] ), 
            G_L_Amount_Numbers[G_L_Amount_No] <> "2220", 
            ALL ( G_L_Amount_Numbers[Index] ) 
        ),
        SUM ( 'Table'[Amount] )
    )
)

Document Account Amount
332211 1110 100
443322 1220 400
554433 2220 300
776655 1450 200
665544 1110 400
998877 1450 900
887766 1450 600
334466 1110 200

@mnb_dk 
please follow the power query transformation details in the sample file.

1.png2.png4.png3.png

Total Amount = 
SUMX ( 
    VALUES ( G_L_Amount_Numbers[Account] ),
    IF ( 
        G_L_Amount_Numbers[Account] = "Total",
        CALCULATE ( 
            SUM ( 'Table'[Amount] ), 
            G_L_Amount_Numbers[Account] <> "2220", 
            ALL ( G_L_Amount_Numbers[Index] ) 
        ),
        SUM ( 'Table'[Amount] )
    )
)

 

Hi

Thanks for taking your time to help.

For some reason my posts keep getting deleted.

 

I would like to add sample data, but there is no way I can add it here. Please see below post for sample data.

Thanks for taking your time to help.

For some reason my posts keep getting deleted.

I would like to add sample data, but there is no way I can add it here.

Can you use below?

 

Document Account Amount
332211 1110 100
443322 1220 400
554433 2220 300
776655 1450 200
665544 1110 400
998877 1450 900
887766 1450 600
334466 1110 200

tamerj1
Super User
Super User

Hi @mnb_dk 
Please provide sample data

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.