Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I need to identify all negative amounts.
If the column contains a corresponding positive amount of the same value I need to identify them as well.
Please help. Thank you in advance.
| Amount | |
| 1 | X |
| 1 | X |
| 1 | X |
| -1 | X |
| -1 | X |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| -3 | X |
| 4 | X |
| 4 | X |
| -4 | X |
Solved! Go to Solution.
Hi @Barry_Sophus ,
You can generate the desired output by creating a calculated column using the following formula:
NegativePositiveCheck =
IF (
COUNTROWS (
FILTER (
'Table',
'Table'[Amount]
= - EARLIER ( 'Table'[Amount] ) -- Find the opposite value using EARLIER
)
) > 0,
"X",
BLANK ()
)
Out of curiosity, what is the purpose of this requirement? Are you aiming to clear balance sheet line items with matching balances? If so, the formula provided is not a complete solution. For proper matching clearance, you need to consider not only the values and signs but also ensure the debits and credits match in even numbers, starting with the earliest dates. In accounting, clearing matching balances requires a more refined formula than simply matching based on value and sign alone.
I have attached an example pbix file:
Hi @Barry_Sophus ,
You can generate the desired output by creating a calculated column using the following formula:
NegativePositiveCheck =
IF (
COUNTROWS (
FILTER (
'Table',
'Table'[Amount]
= - EARLIER ( 'Table'[Amount] ) -- Find the opposite value using EARLIER
)
) > 0,
"X",
BLANK ()
)
Out of curiosity, what is the purpose of this requirement? Are you aiming to clear balance sheet line items with matching balances? If so, the formula provided is not a complete solution. For proper matching clearance, you need to consider not only the values and signs but also ensure the debits and credits match in even numbers, starting with the earliest dates. In accounting, clearing matching balances requires a more refined formula than simply matching based on value and sign alone.
I have attached an example pbix file:
What would be the expected outcome be based on your sample data?
The X's are the expected outcome.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 14 | |
| 8 | |
| 8 | |
| 8 |