I have a format expression like below. SUM(A...

I have a format expression like below.

SUM(ACCOUNTHEADS[Debit]) <>

SUM(ACCOUNTHEADS[Credit])

If Both figure Sum of โ€œDebitโ€ and โ€œCreditโ€ not tallied, the particular field value become red. As per the records, both figures are tallied, see the test expression picture below. But system shows โ€œFalseโ€โ€ฆ what is the problem here? please help me out.

0 12 523
12 REPLIES 12

The test results seem to be correct, because it returns false to not-equal operator (<>) which means both SUM values are evaluated as equal.

@RezaRaoofi I want the format expression in such way that if both โ€œDebitโ€ and โ€œCreditโ€ are not tallied each otherโ€ฆ so what is the correct expression please?

Thanks lot Mr. Reza. It works in different wayโ€ฆactually i forgot the basic rule - system will check the condition row by row. I created two virtual columns to store โ€œsum of debit across the tableโ€ and โ€œsum of credit across the tableโ€. Now i put expression similar to yours. Thanks again.

You are welcome! I am glad you worked it out.

I donโ€™t know what your column structure is, but I am guessing perhaps the SUM values you have calculated always are tallied, meaning you are not calculating any non-equal SUMs of Debit/Credit to trigger the format rule.

@RezaRaoofi Table name is โ€œACCOUNTHEADSโ€ Columns are โ€œDebitโ€ and โ€œCreditโ€ both are โ€œpriceโ€ type.

Yes, but if you sum Credit/Debit across all rows in that table, you will always have only one value for each SUM, unless you have some sort of grouping by another column in order to have different sum values and the format rule evaluate that condition against different SUM values.

You probably need something like: SUM(SELECT(ACCOUNTHEADS[Debit], [Customer]=[_THISROW].[Customer])) <> SUM(SELECT(ACCOUNTHEADS[Credit], [Customer]=[_THISROW].[Customer]))

@Bellave_Jayaram I believe that customer-wise check not required as i try to check both โ€œDebitโ€ and โ€œCreditโ€ figures are matched across the table โ€œAccountHeadsโ€. By above my original expression, it was working fineโ€ฆbut now it turned outโ€ฆ i dont know why?

Well, we know the expression in your Format ruleโ€™s condition, also the first screenshot was showing the right evaluation result (False) from that expression; can you send a screenshot of the AccountHeads tableโ€™s column structure?

@RezaRaoofi Attached below is the AccountHeads Table column structure please.

Hmm, I think you need to remove those SUM() functions from your format rule condition; perhaps something like: AccountHeads[Debit] <> AccountHeads[Credit] or AccountHeads[Debit Total] <> AccountHeads[Credit Total] or AccountHeads[Debit Balance] <> AccountHeads[Credit Balance]

Each row in AcocuntHeads must have different distinct values for [Debitโ€ฆ]/[Creditโ€ฆ] columns in order for format rule to work; otherwise if you SUM across all rows in AccountHeads table like SUM(AccountHeads[Debit]) in format ruleโ€™s condition, it will always return the same SUM value for all rows, therefore you will see no different formatting from row to row.

Top Labels in this Space