Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Power BI total not displaying properly

I am new to Power BI. I have a measure which uses formula to compute Revenue change price $. The individual rows line by line are all correct, except that the "Total" displays -76,814,641.80 for column Revenue change Price $. The actual number should be -61,508.2. The total for this column is doing the (PY total price $ minus CY total price $) * PY total volume, resulting in (10201.31-12,277.38) * 37000 = -76,814,641.80. 

 

I tried creating a calculated column instead of a measure but keep getting loop issues in the formula. Is there a simple way to have the Revenue Price change $ column just sum the records instead of how it is calculated now? Should I contine using a calculated measure or should use a calculated column rather? Can someone help with the formula please? Thanks!

 

Note:

1.Price $ variance = CY Total Price $ - PY Total Price $

2. Also attached excel screenshot for reference where the total (sum) is displayed as -61,508 for column K (Revenue change price $).

  • Anonymous's avatar
    Anonymous
    1 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 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


  • Anonymous's avatar
    Anonymous
    1 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:

    https://community.fabric.microsoft.com/t5/Desktop/Totals-not-displaying-properly-in-Power-BI-Desktop-Table/m-p/4743853

     

    Your answer makes so much sense, about using SUMMARIZE or VALUES. Thank you much for putting the time and efforts on this, appreciate it!!

7 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Philip! My issue got resolved (see link in reply above), but looks like a great training hub for Power BI! I'll check your site to learn more, thanks!

  • Anonymous's avatar
    Anonymous
    Not applicable

    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


    • Anonymous's avatar
      Anonymous
      Not 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:

      https://community.fabric.microsoft.com/t5/Desktop/Totals-not-displaying-properly-in-Power-BI-Desktop-Table/m-p/4743853

       

      Your answer makes so much sense, about using SUMMARIZE or VALUES. Thank you much for putting the time and efforts on this, appreciate it!!

      • Anonymous's avatar
        Anonymous
        Not 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.

         

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
    Thank you.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the community members for the issue worked. If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

     

    Thanks and regards