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.
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.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
23 | |
10 | |
10 | |
9 | |
7 |