Forum Discussion

brittanyruffin's avatar
1 year ago
Solved

Rounding Issue Stacked Bar Chart

Hi everyone,

Hoping someone can help me here. I have a stacked bar chart and the total values are correct but the %s in the categories are not totalling the total values. Clearly a rounding issue but curious if anyone has had any luck on how to get these to match. They only want the 1 decimal so need to figure out a solution. 

 

 

 

 

  • Hi brittanyruffin ,

    Thanks for reaching out to the Microsoft fabric community forum.

    Elena_Kalina ,

    ajaybabuinturi 

    Thanks for your prompt response

     

    As mentioned by Elena_Kalina , using DAX is the most effective way to achieve the desired output.

    I’ve uploaded the PBIX file with a sample dataset and implemented the same logic. Kindly review it and share your feedback on whether it works for your current use case.

     

     

     

     

    If you are still encountering any challenges, we would be happy to assist you further.

    Best Regards,

    Lakshmi Narayana

     

     

7 Replies

  • Hi brittanyruffin,

    Wanted to let you know that each category's percentage is individually rounded, but when you sum all these rounded values, the total can end up being more or less than 100%, even though the actual math behind the scenes is correct.

    Thanks,
    If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

  • Hi brittanyruffin 

    This discrepancy occurs because each category is rounded separately, while the total is obtained not by summing the rounded values of the categories but simply by rounding the overall value. However, if you want the total to match the sum of the rounded category values, you can use DAX for this—create a formula to calculate the rounded values of the categories and use this formula instead of the automatic total.

    If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

    Thank you.

  • v-lgarikapat's avatar
    v-lgarikapat
    Community Support

    Hi brittanyruffin ,

    Thanks for reaching out to the Microsoft fabric community forum

     

    To help us understand your issue better, please share sample data that clearly shows the problem (in text or table format, not a screenshot), without including any sensitive or unrelated information, and also show the expected result based on that data. If possible, share the PBIX file as well, provided it doesn’t contain any sensitive information.

    Looking forward to your response.

    Best Regards,

    Lakshmi Narayana

  • v-lgarikapat's avatar
    v-lgarikapat
    Community Support

    Hi brittanyruffin ,

    Thanks for reaching out to the Microsoft fabric community forum.

    Elena_Kalina ,

    ajaybabuinturi 

    Thanks for your prompt response

     

    As mentioned by Elena_Kalina , using DAX is the most effective way to achieve the desired output.

    I’ve uploaded the PBIX file with a sample dataset and implemented the same logic. Kindly review it and share your feedback on whether it works for your current use case.

     

     

     

     

    If you are still encountering any challenges, we would be happy to assist you further.

    Best Regards,

    Lakshmi Narayana

     

     

    • v-lgarikapat's avatar
      v-lgarikapat
      Community Support

      Hi brittanyruffin ,

      I wanted to follow up and confirm whether you’ve had the opportunity to review the information we provided. Should you have any questions or require further clarification, please don't hesitate to reach out.

       

      Best Regards,

      Lakshmi Narayana

      • v-lgarikapat's avatar
        v-lgarikapat
        Community Support

        Hi brittanyruffin ,

        I wanted to follow up and confirm whether you’ve had the opportunity to review the information we provided. Should you have any questions or require further clarification, please don't hesitate to reach out.

         

        Best Regards,

        Lakshmi