Forum Discussion

PeterRLC's avatar
PeterRLC
Frequent Visitor
6 years ago
Solved

Trial Balance Total Incorrect

Totals 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]))       
)
  • 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])
    )

4 Replies

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi PeterRLC ,

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

     

    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

    • PeterRLC's avatar
      PeterRLC
      Frequent Visitor

       

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

      • PeterRLC's avatar
        PeterRLC
        Frequent Visitor

        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])
        )