Forum Discussion
DAX total != total rows
- 9 months ago
Hi SaaM ,
It is likely that your total doesn't work because you have multiple columns which is affecting your filter condition. In order for the sumx solution to work you will need to incorporate all the filter condition columns into your sumx formula. An example of the formula is as shown below:
Calcul_incremental_Total = SUMX( SUMMARIZE( 'YourTable', 'YourTable'[Column1], 'YourTable'[Column2] ), IF([diff_CA] > 0, [diff_CA], 0) )Would you like me to generate the exact dax formula to fix the total? If so, please let me know which columns are currently listed in the rows section of your table visual.
Best regards,
Hi SaaM,
I hope you are doing well today 🙂❤️
There are two solutions you can use to fix the totals issue in your table visual.
Both ensure the total equals the sum of the row values:
Solution 1: Using SUMX with IF
Calcul_incremental :=
SUMX (
VALUES ( YourTable[YourRowColumn] ),
VAR Diff = SUM ( YourTable[CA N] ) - SUM ( YourTable[CA N-1] )
RETURN
IF ( Diff > 0, Diff, 0 )
)- Evaluates row by row
- Applies the condition per row
- Totals now match the sum of rows
Solution 2: Using SUMX with MAX (shorter)
Calcul_incremental :=
SUMX (
VALUES ( YourTable[YourRowColumn] ),
MAX ( SUM ( YourTable[CA N] ) - SUM ( YourTable[CA N-1] ), 0 )
) - Shorter, cleaner syntax
- Works exactly the same
- Ensures totals equal the sum of rows
Work Notes:
- Replace YourTable[YourRowColumn] with the column that defines each row in your table
- e.g., Customer, Account, Product
- Both approaches work for table, matrix, and card visuals
If this answer helped, kindly give Kudos and mark it as the Accepted Solution
to help other members find it more quickly.
Best regards,
Vaibhav Mahajan