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
Barry_Sophus
Frequent Visitor

Identify Duplicates +/- but only if -

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 
1X
1X
1X
-1X
-1X
2 
2 
2 
2 
-3X
4X
4X
-4X
1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

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 ()
)

 

DataNinja777_0-1727581121434.png

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:

 

View solution in original post

3 REPLIES 3
DataNinja777
Super User
Super User

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 ()
)

 

DataNinja777_0-1727581121434.png

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:

 

lbendlin
Super User
Super User

What would be the expected outcome be based on your sample data?

The X's are the expected outcome.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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