The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi
I have a simple measure =
The correct table should look like this
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:
correct total being the formula aboce, distinct invoice being the initial simple formula you wrote. The data as reference:
I hope this helps!
Proud to be a Super User! | |