Forum Discussion

ChrisR22's avatar
ChrisR22
Icon for Helper III rankHelper III
1 year ago
Solved

Dax formula to compare values between two columns based on common category

Hello,

 

I have two tables, each share a common field (General Ledger Account) and I am seeking to compare a value column from each table ('Debits' and 'Base Currency Amount (Dr)').

I am trying to write a measure that will declare whether these match when pivoted based on the General Ledger Account field.

This is my formula:

Debits Match =
var _Table1 = SELECTEDVALUE(EntityGeneralLedger[Base Currency Amount (Dr)])
var _Table2 = SELECTEDVALUE(TrialBalance[Debits])
return
IF(ROUND(_Table1, 2) = ROUND(_Table2,2), "Match", "Break")
 
However I am getting a break that doesn't make sense, as the values are exactly the same (see 'Interest Receivable' row).

 

Can anyone help me fix this, or provide an approach that makes more sense?

 

Thanks!

 
  • Hi ChrisR22 ,

     

    If this is based on values, I believe that you should use the SUM value and not the SELECTEDVALUE, since this returns the value when the context for columnName has been filtered down to one distinct value only, you can get different results based on the context you give.

1 Reply

  • Hi ChrisR22 ,

     

    If this is based on values, I believe that you should use the SUM value and not the SELECTEDVALUE, since this returns the value when the context for columnName has been filtered down to one distinct value only, you can get different results based on the context you give.