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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ChrisR22
Helper III
Helper III

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).
ChrisR22_0-1740427658381.png

 

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

 

Thanks!

 
1 ACCEPTED SOLUTION
MFelix
Super User
Super User

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.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

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.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.