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
KG1
Resolver I
Resolver I

Incorrect Total in Matrix

Hi

 

I have a simple measure = 

Distinct Count Invoices = DISTINCTCOUNT('All Oracle Invoices Processed'[INVOICE_NUM])
 
There are no filters needed
 
The matrix totals are incorrect
 
The month / year is from a date table and the values are summarised from a category table  (Simple data model)
 
KG1_0-1699606875661.png

 

KG1_2-1699606919305.png

 

 

The correct table should look like this

KG1_3-1699607238774.png

 

 
 
1 REPLY 1
dk_dk
Super User
Super User

The numbers are "wrong" in the matrix most likely because on a few occasions, the same invoice number occurs in different months in the data. They are distinctly counted under each month they occur in (so the same invoice num will be counted for instance in july and in august, but in the total column they will only be distinclty counted once for the entire period) so the total is less than if you just added up all the numbers in the columns.


If this is not expected from your data then you should keep your measure the same and have your datasource fixed so that each invoice num only occurs in a single month.

If this is expected, and the expected result you want to show is the one in your excel sheet (which is counting some of the same invoice nums multiple times) then you need to modify your measure like so:

Distinct Count Invoices = 

VAR t =
    SUMMARIZE (
        'All Oracle Invoices Processed',
        All Oracle Invoices Processed[Date],
        "DistInvoice", DISTINCTCOUNT('All Oracle Invoices Processed'[INVOICE_NUM])
    )
RETURN
    SUMX ( t, [DistInvoice] )

This formula I found in another solution here.
You may need to edit the Summarize function to include the categorical column that constitutes the rows in your screenshot.

I have made a simple test dataset (without the categories) and it worked fine:

Result:

dk_dk_0-1699620109799.png

correct total being the formula aboce, distinct invoice being the initial simple formula you wrote. The data as reference:

dk_dk_1-1699620194794.png

I hope this helps!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





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!

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
Top Kudoed Authors