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,
- For each row:
Calcul_incremental = IF(diff_CA > 0, diff_CA, 0)
works correctly because diff_CA is evaluated per row. - For the total:
The same formula runs in the grand total context, where diff_CA is aggregated across all rows first. If the combined diff_CA is negative, the condition fails, and the total shows a smaller value.
Please, try something like this:
Calcul_incremental =
SUMX(
VALUES('YourTable'[YourGroupingColumn]),
IF([diff_CA] > 0, [diff_CA], 0)
)
If this response was helpful in any way, Iβd gladly accept a πmuch like the joy of seeing a DAX measure work first time without needing another FILTER.
Please mark it as the correct solution. It helps other community members find their way faster (and saves them from another endless loop π.
unfortunately it is not as I don't get the result expected using the formula suggested:
How should I proceed to have the total that equals 0.00 + 129367.62
Thanks
Kind regards,
SaaM
- DataNinja7779 months ago
Super User
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,
- SaaM9 months ago
Helper II
Thank you so much DataNinja777 , your solution works !