Forum Discussion
Power BI Summation Error
- 5 years ago
Hi Anonymous
How did you filter out all negative amounts? Using the filter pane? If so, filtering may happen after the aggregation sum.
In your scenario, I think it would be better to use a measure to calculate the sum of positive amounts per month. E.g.
total = CALCULATE ( SUM ( 'Table'[amount] ), 'Table'[amount] >= 0 )or
total = SUMX ( FILTER ( 'Table', 'Table'[amount] >= 0 ), 'Table'[amount] )You can put above measure into the table visual to replace Amount(USD) column. In the measure, filtering happens earlier than aggregation sum.
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
Hi Anonymous
How did you filter out all negative amounts? Using the filter pane? If so, filtering may happen after the aggregation sum.
In your scenario, I think it would be better to use a measure to calculate the sum of positive amounts per month. E.g.
total = CALCULATE ( SUM ( 'Table'[amount] ), 'Table'[amount] >= 0 )
or
total = SUMX ( FILTER ( 'Table', 'Table'[amount] >= 0 ), 'Table'[amount] )
You can put above measure into the table visual to replace Amount(USD) column. In the measure, filtering happens earlier than aggregation sum.
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.