Forum Discussion
Power BI total not displaying properly
- Anonymous1 year ago
Hi Anonymous ,
Thanks for reaching out to the Microsoft fabric community forum.
Power BI can often miscalculate totals because it lacks row context when evaluating measures. To ensure accurate total calculations, especially when working with groups like categories or months, it's effective to use SUMX in combination with SUMMARIZE. This approach instructs Power BI to iterate over each group and apply the logic at the correct granularity. Additionally, using CALCULATE helps enforce context transition, which is essential for maintaining accurate row-level calculations at the total level.
Use SUM when you need to aggregate a single column without any row-by-row logic. In contrast, use SUMX when your calculation depends on evaluating each row individually for example, computing (PY Price – CY Price) × Volume for each item. If your totals appear incorrect, it’s often because Power BI is applying your formula to aggregated values rather than summing row-level results. To fix this, wrap your logic inside SUMX, optionally combined with SUMMARIZE or VALUES, to ensure proper row-wise evaluation and accurate totals.
Modify your DAX measure and check the TotalRevenue Change Price $ = SUMX ( SalesData, (SalesData[PY Total Price $] - SalesData[CY Total Price $]) * SalesData[PY Total Volume] )
If this post helps, then please consider Accepting as solution to help the other members find it more quickly and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you - Anonymous1 year ago
Thanks for the detailed explanation! I was having trouble posting this initial post, and since this was not getting posted, I had to create a new post about the issue, and it got resolved. Please see below:
Your answer makes so much sense, about using SUMMARIZE or VALUES. Thank you much for putting the time and efforts on this, appreciate it!!
Hi Anonymous ,
Thanks for reaching out to the Microsoft fabric community forum.
Power BI can often miscalculate totals because it lacks row context when evaluating measures. To ensure accurate total calculations, especially when working with groups like categories or months, it's effective to use SUMX in combination with SUMMARIZE. This approach instructs Power BI to iterate over each group and apply the logic at the correct granularity. Additionally, using CALCULATE helps enforce context transition, which is essential for maintaining accurate row-level calculations at the total level.
Use SUM when you need to aggregate a single column without any row-by-row logic. In contrast, use SUMX when your calculation depends on evaluating each row individually for example, computing (PY Price – CY Price) × Volume for each item. If your totals appear incorrect, it’s often because Power BI is applying your formula to aggregated values rather than summing row-level results. To fix this, wrap your logic inside SUMX, optionally combined with SUMMARIZE or VALUES, to ensure proper row-wise evaluation and accurate totals.
Modify your DAX measure and check the Total
Revenue Change Price $ =
SUMX (
SalesData,
(SalesData[PY Total Price $] - SalesData[CY Total Price $]) * SalesData[PY Total Volume]
)
If this post helps, then please consider Accepting as solution to help the other members find it more quickly and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you
- Anonymous1 year agoNot applicable
Thanks for the detailed explanation! I was having trouble posting this initial post, and since this was not getting posted, I had to create a new post about the issue, and it got resolved. Please see below:
Your answer makes so much sense, about using SUMMARIZE or VALUES. Thank you much for putting the time and efforts on this, appreciate it!!
- Anonymous1 year agoNot applicable
Hi Anonymous ,
If your issue has been resolved, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.