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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
MegaOctane1
Helper I
Helper I

Need to compare two tables and count number of customers not in balance

I have three tables.

Table 1 CustomerMaster:

CustomerNumberCustomer Name
100Apple
101Microsoft

 

Table 2, Open invoices in ERP:

CustomerNumberInvoiceAmount
10031000
10042000
10153000

 

Table 3, Open invoices InvoicePartner:

CustomerNumberInvoiceAmount
10031000
10153000


Skjermbilde 2023-10-15 121334.png

Relationship is on KundeNummer in each table. 

 

I have a measure to calculate the difference of these two tables. 
Measure is:

Difference = VAR _DIFF_CHECK = [SUM ERP]-[SUM InvoicePartner] Return IF(_DIFF_CHECK<>0, _DIFF_CHECK)


it returns this:

CustomerNumberDifference
1002000
1010

 

How can i create a card visual/measure to say that number of customers with difference is 1?

i am not able to do a countIF(Difference<>0)

1 ACCEPTED SOLUTION
123abc
Community Champion
Community Champion

To create a card visual or measure that displays the number of customers with differences in the "Difference" measure, you can follow these steps:

  1. Create a new measure that calculates the count of customers with differences:

CountOfCustomersWithDifferences = COUNTROWS(FILTER(CustomerMaster, [Difference] <> 0))

 

This measure counts the rows in the "CustomerMaster" table where the "Difference" measure is not equal to 0.

  1. Add a card visual to your report.

  2. In the card visual, use the "CountOfCustomersWithDifferences" measure as the value to display.

Now, your card visual will show the number of customers with differences in their invoices. If the "Difference" measure is not equal to 0 for a customer, it will be counted in this card visual. In your example data, it will show "1" because there is one customer with a difference (CustomerNumber 100).

 

View solution in original post

2 REPLIES 2
Dangar332
Super User
Super User

Hi, @MegaOctane1 

try below with same relationship which you mention
make measure in customer master table 
 
diff =
var a =SUM('invoice partner'[Amount])
var b = SUM('open invoice'[Amount])
return
ABS(a-b)
 
Dangar332_0-1697526932209.png

 

 
and use customer number  in table visuals from your master table 
 

 

 

 

123abc
Community Champion
Community Champion

To create a card visual or measure that displays the number of customers with differences in the "Difference" measure, you can follow these steps:

  1. Create a new measure that calculates the count of customers with differences:

CountOfCustomersWithDifferences = COUNTROWS(FILTER(CustomerMaster, [Difference] <> 0))

 

This measure counts the rows in the "CustomerMaster" table where the "Difference" measure is not equal to 0.

  1. Add a card visual to your report.

  2. In the card visual, use the "CountOfCustomersWithDifferences" measure as the value to display.

Now, your card visual will show the number of customers with differences in their invoices. If the "Difference" measure is not equal to 0 for a customer, it will be counted in this card visual. In your example data, it will show "1" because there is one customer with a difference (CustomerNumber 100).

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors