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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
PeterRLC
Frequent Visitor

Trial Balance Total Incorrect

Totals should be  1,177,009.73Totals should be 1,177,009.73

 

I want the total of my Trial Balance to equal the displayed line values.  The problem is that the displayed line values are sorted to Dr or Cr based on their SUMMARY level sign, positive is Dr, negative is Cr.  I have tried 4 different calculations and the best is this one but the part in red is not calculating the total correctly:

 

TB. Cr S1 = IF (
    HASONEVALUE (xFMS_iFAMS_Base_Journal_FY19[FMS-iFAMS GL]),
        if(sum(xFMS_iFAMS_Base_Journal_FY19[Amount])<0, -sum(xFMS_iFAMS_Base_Journal_FY19[Amount])),
            sumx( all(xFMS_iFAMS_Base_Journal_FY19[FMS-iFAMS GL]),-sum(xFMS_iFAMS_Base_Journal_FY19[Amount]))       
)
1 ACCEPTED SOLUTION

Solved it! Thanks to Measure-Totals-The-Final-Word Measure total basics.  The correct calculation shows up circled in blue below.  Any problems with this solution?

 

TB. Dr Var =
VAR __Table = SUMMARIZE( xFMS_iFAMS_Base_Journal_FY19, [FMS-iFAMS GL], "TB Total", [TB. Dr S1])

Return
SWITCH(True(),
    HASONEVALUE( xFMS_iFAMS_Base_Journal_FY19[FMS-iFAMS GL]),[TB. Dr S1],
    sumx(__Table, [TB Total])
)TB Calculation problem Fixed.PNG

View solution in original post

4 REPLIES 4
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @PeterRLC ,

From the information you provided, I could only get the output like this.

Capture.PNG

 

If it is convenient, could you share your data sample which could reproduce the scenario as table format and your desired output so that we could give further advice on it?

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

TB Calculation problem.PNG

 

Yes, here is the original amount column.  I want to sort negatives to the credit column and positives to the debit column.

Solved it! Thanks to Measure-Totals-The-Final-Word Measure total basics.  The correct calculation shows up circled in blue below.  Any problems with this solution?

 

TB. Dr Var =
VAR __Table = SUMMARIZE( xFMS_iFAMS_Base_Journal_FY19, [FMS-iFAMS GL], "TB Total", [TB. Dr S1])

Return
SWITCH(True(),
    HASONEVALUE( xFMS_iFAMS_Base_Journal_FY19[FMS-iFAMS GL]),[TB. Dr S1],
    sumx(__Table, [TB Total])
)TB Calculation problem Fixed.PNG

Is it possibly a memory hog?  And what would the solution be for that?

 

Also tried: (Calculates correctly but also runs out of memory)

TB. Ending Balance Dr =
if(
HASONEVALUE( xFMS_iFAMS_Base_Journal_FY19[FMS-iFAMS GL]),[TB. Dr S1],
sumx(SUMMARIZE( xFMS_iFAMS_Base_Journal_FY19, [FMS-iFAMS GL], "TB Total", [TB. Dr S1]), [TB Total])
)

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.