Forum Discussion
Mouseman85
Helper I
2 years agoSimple SUM of a column not adding correctly
Hi, I have an issue where the total on a table visual is not adding correctly when a date range slicer is applied, but when export the table visual as a CSV the totals are correct ; the...
lbendlin
Super User
2 years agoYour sample data displays fine. Are any of the fields based on measures?
What you can do in Power BI is look at the query for the visual .
this might be different from the query you run for the extract.
Mouseman85
Helper I
2 years agoThis is what the performance analyzer is showing the slicer is doing, i'm not 100% sure what i'm looking at.
// DAX Query
DEFINE
VAR __DS0FilterTable =
FILTER(
KEEPFILTERS(VALUES('DateTable'[Date])),
'DateTable'[Date] < DATE(2023, 10, 1)
)
VAR __DS0FilterTable2 =
TREATAS({"Balance Not Raised"}, 'SaleSheet'[Fully Invoiced])
VAR __DS0FilterTable3 =
TREATAS({"active",
"completed",
"reconciled",
BLANK()}, 'SaleSheet'[Project Status])
VAR __DS0Core =
SUMMARIZECOLUMNS(
ROLLUPADDISSUBTOTAL(
ROLLUPGROUP(
'SaleSheet'[Client],
'SaleSheet'[Project No/Name],
'SaleSheet'[Project - Project Owner],
'Accounts Key'[Account Lead],
'SaleSheet'[Project Department],
'SaleSheet'[Project Completion Date],
'SaleSheet'[Project Additional Notes],
'SaleSheet'[Fully Invoiced],
'SaleSheet'[InvoiceOutstanding]
), "IsGrandTotalRowTotal"
),
__DS0FilterTable,
__DS0FilterTable2,
__DS0FilterTable3,
"SumWorking_Budget", CALCULATE(SUM('SaleSheet'[Working Budget])),
"SumFinal_Accounts_Invoice_Value", CALCULATE(SUM('SaleSheet'[Final Accounts Invoice Value])),
"SumOutstanding_Invoice_Amount", CALCULATE(SUM('SaleSheet'[Outstanding Invoice Amount])),
"MaxColorID", IGNORE(CALCULATE(MAX('ColourID'[ColorID])))
)
VAR __DS0PrimaryWindowed =
TOPN(
502,
__DS0Core,
[IsGrandTotalRowTotal],
0,
[SumWorking_Budget],
0,
'SaleSheet'[Client],
1,
'SaleSheet'[Project No/Name],
1,
'SaleSheet'[Project - Project Owner],
1,
'Accounts Key'[Account Lead],
1,
'SaleSheet'[Project Department],
1,
'SaleSheet'[Project Completion Date],
1,
'SaleSheet'[Project Additional Notes],
1,
'SaleSheet'[Fully Invoiced],
1,
'SaleSheet'[InvoiceOutstanding],
1
)
EVALUATE
__DS0PrimaryWindowed
ORDER BY
[IsGrandTotalRowTotal] DESC,
[SumWorking_Budget] DESC,
'SaleSheet'[Client],
'SaleSheet'[Project No/Name],
'SaleSheet'[Project - Project Owner],
'Accounts Key'[Account Lead],
'SaleSheet'[Project Department],
'SaleSheet'[Project Completion Date],
'SaleSheet'[Project Additional Notes],
'SaleSheet'[Fully Invoiced],
'SaleSheet'[InvoiceOutstanding]- lbendlin2 years ago
Super User
Confirm that the three filters are present in both queries
VAR __DS0FilterTable = FILTER( KEEPFILTERS(VALUES('DateTable'[Date])), 'DateTable'[Date] < DATE(2023, 10, 1) ) VAR __DS0FilterTable2 = TREATAS({"Balance Not Raised"}, 'SaleSheet'[Fully Invoiced]) VAR __DS0FilterTable3 = TREATAS({"active", "completed", "reconciled", BLANK()}, 'SaleSheet'[Project Status])- Mouseman852 years ago
Helper I
that still doesn't explain that why when it filters the results left don't add up correctly in the total, but when you manually add up the numbers using a calculater they are different to what the the total in the SUM is showing?