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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Difference between two rows if there is one column the same

Hi all,

 

I'm trying to create an overview from our accounting system with the outstanding items of our debtors.
For this we have a view that has already collected all data.

So now I actually have a pretty simple overview in which I see a line of the invoice and whether a paid amount is attached to it.
The problem, however, is with the transition of the year.

Throughout the year, everything is entered in the 'Purchase' diary. But at the beginning of the year, an opening balance sheet is drawn up (to include last year's outstanding items).
As a result, I now see one invoice number twice in my view.

Row A:
Invoice number: 123456789
Date: 31-12-2020
Amount: 1000, -
Payed: 0, -
Open: 1000, -
Diary: Purchase

Row B:
Invoice number: 123456789
Date: 31-12-2020
Amount: 1000, -
Payed: 1000, -
Open: 0
Diary: Opening balance

 

So the invoice has been payed, but the line from the 'Purchase' diary will still be open.


Is there a smart way, perhaps with DAX, to let PowerBI search for the same outstanding amount on journal 'sales' unless another line exists in journal 'start balance'.

Or maybe someone has a completely different idea?

 

Thanks in advance for any suggestions!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  

Please try this measure.

Filter = 
VAR _FatNum =CALCULATETABLE( VALUES('Table'[OspFactuurNummer]),FILTER('Table','Table'[OspOpenstaand] = 0))
Return
IF(MAX('Table'[OspFactuurNummer]) in _FatNum,0,1)

Build a matrix as your screenshot , add this measure into filter field and set this measure to show items when value = 1.

Result is as below.

1.png

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous 

Does RowA and RowB two rows in the same table?

My Sample:

1.png

Measure = 
VAR _Count = COUNTAX(FILTER(ALL('Table'),'Table'[Invoice number] = MAX('Table'[Invoice number])),'Table'[Invoice number])
Return
CALCULATE(DISTINCTCOUNT('Table'[Invoice number]),FILTER(ALL('Table'),_Count>=2&& 'Table'[Date] = DATE(2020,12,31)&&'Table'[Diary]<>"start balance"))

Result :

2.png

If this reply still couldn't help you solve your problem, please share a sample with me.

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Anonymous
Not applicable

Hi @Anonymous ,

 

First off: thank you for your reply!

 

These rows are indeed in the same Table.

So I want to create a overview with all of the 'open invoices' (amount, not count).

But i'm getting an error when i'm using your Measure.

I do think that i made a mistake in replacing some of the tables.

Here is a short example of the database:

OspFactuurNummer ; invoice number

OspFactuurBedrag: invoice amount

OspBetaaldBedrag: payed amount

OspOpenstaand: open amount

 

So the result I would like to see that is 

Invoice:

1703562 - payed (not showing in chart)

1703563 - open (showing in chart)

1703564 - open (showing in chart)

1703565 - open (showing in chart)

I can't add a pbix or xlsx file, how can i share a example? Or just images:

 

example 1.pngexample 2.png

Anonymous
Not applicable

Hi  

Please try this measure.

Filter = 
VAR _FatNum =CALCULATETABLE( VALUES('Table'[OspFactuurNummer]),FILTER('Table','Table'[OspOpenstaand] = 0))
Return
IF(MAX('Table'[OspFactuurNummer]) in _FatNum,0,1)

Build a matrix as your screenshot , add this measure into filter field and set this measure to show items when value = 1.

Result is as below.

1.png

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

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.

Top Solution Authors