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