Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi, Expert,
I wish to create a measure in the Power BI to match the following condition but unable to get the correct matching:
I have 2 tables: Bank and GL
In the bank table, there is a deposit on 1/4/2025 amounted to RM410 = column Bank[In]
In the GL table, there are 2 transactions on 1/4/2025, one RM214.80, another one RM195.20 which make up of the total of RM410 and these 2 transactions both referenced by:
a) 410.00 (numeric) in the column GL[Clean Ref Numeric]
b) 214.80 (one row) and 195.20 (another row) in the column GL[Debit]
My Goal is:
Create a DAX measure that matches Bank deposits (Bank[In]) to the grouped GL entries based on total amount (GL[Debit]) and reference number in GL[Clean Ref Numeric].
I created the below DAX but still unable to match it correctly:
IsBankMatched =
VAR SelectedBankIn = SELECTEDVALUE(Bank[In])
VAR GLTotal = CALCULATE(SUM(GL[Debit]),
FILTER(GL,GL[Clean Ref Numeric] = SelectedBankIn))
RETURN IF(SelectedBankIn = GLTotal, "Matched", "Not Matched")
Appreciate for the advices.
Solved! Go to Solution.
@wongts_nms try with:
IsBankMatched =
VAR SelectedBankIn = SELECTEDVALUE(Bank[In])
VAR GLTotal =
CALCULATE(
SUM(GL[Debit]),
FILTER(
GL,
GL[Clean Ref Numeric] = SelectedBankIn
)
)
RETURN
IF(
NOT ISBLANK(SelectedBankIn)
&& ABS(GLTotal - SelectedBankIn) < 0.01,
"Matched",
"Not Matched"
)
BBF
Try and see if this works:
IsBankMatched =
VAR _BankIn = SELECTEDVALUE(Bank[In])
VAR _Date = SELECTEDVALUE(Bank[Date])
VAR GLTotal = CALCULATE( SUM(GL[Debit]),
FILTER( ALL(GL), GL[Clean Ref Numeric] = _BankIn && GL[Date] = _Date)
)
-- RETURN IF( NOT ISBLANK(_BankIn) && NOT ISBLANK(_Date) && ABS(GLTotal - _BankIn) < 0.01,
-- RETURN IF ( HASONEVALUE ( Bank[In]) && HASONEVALUE(Bank[Date]) && ABS(GLTotal - _BankIn) < 0.01,
RETURN IF( ABS(GLTotal - _BankIn) < 0.01,
"Matched", "Not Matched"
)
ALL(GL) or ALLSELECTED(GL) based on your needs, if the above formula works!
Hi @wongts_nms ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithra.
Hi @wongts_nms ,
May I ask if you have gotten this issue resolved?
If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.
Regards,
Chaithra.
Hi @wongts_nms ,
We would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Regards,
Chaithra E.
Try and see if this works:
IsBankMatched =
VAR _BankIn = SELECTEDVALUE(Bank[In])
VAR _Date = SELECTEDVALUE(Bank[Date])
VAR GLTotal = CALCULATE( SUM(GL[Debit]),
FILTER( ALL(GL), GL[Clean Ref Numeric] = _BankIn && GL[Date] = _Date)
)
-- RETURN IF( NOT ISBLANK(_BankIn) && NOT ISBLANK(_Date) && ABS(GLTotal - _BankIn) < 0.01,
-- RETURN IF ( HASONEVALUE ( Bank[In]) && HASONEVALUE(Bank[Date]) && ABS(GLTotal - _BankIn) < 0.01,
RETURN IF( ABS(GLTotal - _BankIn) < 0.01,
"Matched", "Not Matched"
)
ALL(GL) or ALLSELECTED(GL) based on your needs, if the above formula works!
Hello, BBF,
Thank you so much for your prompt advices. I have tried the both solutions but still unable to match the Bank deposits (Bank[In]) to the grouped GL entries based on total amount (GL[Debit]) and reference number in GL[Clean Ref Numeric]. Below are the sample data:
GL Table
Date | Debit | Clean Ref Numeric |
02/04/2025 | 1,144.57 | 1,580.00 |
02/04/2025 | 379.50 | 1,580.00 |
02/04/2025 | 55.93 | 1,580.00 |
Date | Debit | Clean Ref Numeric |
01/04/2025 | 214.80 | 410.00 |
01/04/2025 | 195.20 | 410.00 |
Bank Table
Date | In |
01/04/2025 | 410.00 |
02/04/2025 | 1,580.00 |
Appreciate any examples or advice!
@wongts_nms try with:
IsBankMatched =
VAR SelectedBankIn = SELECTEDVALUE(Bank[In])
VAR GLTotal =
CALCULATE(
SUM(GL[Debit]),
FILTER(
GL,
GL[Clean Ref Numeric] = SelectedBankIn
)
)
RETURN
IF(
NOT ISBLANK(SelectedBankIn)
&& ABS(GLTotal - SelectedBankIn) < 0.01,
"Matched",
"Not Matched"
)
BBF
Hi @wongts_nms ,
You want to match a deposit in your Bank table to grouped transactions in your GL table based on amount and reference number. The reply you received gives you two DAX solutions: one for models where Bank and GL tables have a direct relationship, and another using TREATAS for when there is no relationship.
Key points:
If the measure is not working as expected, double-check for data type mismatches, formatting issues, or context problems in your visual.
If your scenario is more complex, or you need to match on multiple fields or with tolerances, share more details and I can help you adjust the DAX. Let me know if you need an example with your sample data.
translation and formatting supported by AI
@wongts_nms Hi! Try with:
IsBankMatched =
VAR SelectedBankIn = SELECTEDVALUE(Bank[In])
VAR GLTotal =
CALCULATE(
SUM(GL[Debit]),
FILTER(
GL,
GL[Clean Ref Numeric] = SelectedBankIn
)
)
RETURN
IF(
NOT(ISBLANK(SelectedBankIn)) &&
SelectedBankIn = GLTotal,
"Matched",
"Not Matched"
)
If your model doesn’t have a relationship between Bank and GL:
IsBankMatched =
VAR SelectedBankIn = SELECTEDVALUE(Bank[In])
VAR GLTotal =
CALCULATE(
SUM(GL[Debit]),
TREATAS(
{ SelectedBankIn },
GL[Clean Ref Numeric]
)
)
RETURN
IF(
NOT(ISBLANK(SelectedBankIn)) &&
SelectedBankIn = GLTotal,
"Matched",
"Not Matched"
)
BBF
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
9 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
11 | |
11 | |
10 | |
6 |