Forum Discussion
Infinity error in bar graph
Hi all,
I am new to powerbi. I am trying to resolve a query of dashboard prepared by someone else. In the current scenario when we filter two years (2021 & 2022) we get Infinity value for Jan - June and not for the other months as we can see in the screenshot shared below. I am trying to understand why is this happening and can you also provide me a solution to handle this inifinity. Attaching the screen shot for your reference. Help would be much appreciated. 🙂
Hi Anonymous ,
I created two measures to compare the differences between the DIVIDE function and "/". As you can see below, the DIVIDE function automatically handle division by zero cases. By default this function returns BLANK when the denominator is zero or BLANK, while the division operator "/" will return "Infinity".
DIVIDE = DIVIDE(SUM('Table'[Column1]), SUM('Table'[Column2]))Column1 / Column2 = SUM('Table'[Column1]) / SUM('Table'[Column2])For more information, please refer to:
https://docs.microsoft.com/dax/divide-function-dax
DIVIDE function vs. divide operator (/)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- amitchandakSuper User
Anonymous , are you using some A/B measure, If yes Try like Divide(A,B)
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.- AnonymousNot applicable
Hi amitchandak your solution did help thankyou. But can you explain me why was this happening and how did we get the values because of divide function. This is for me to understand and explain my stakeholder the reason behind it was showing inifinity below and now its not. That would be much appreciated.
- v-kkf-msftCommunity Support
Hi Anonymous ,
I created two measures to compare the differences between the DIVIDE function and "/". As you can see below, the DIVIDE function automatically handle division by zero cases. By default this function returns BLANK when the denominator is zero or BLANK, while the division operator "/" will return "Infinity".
DIVIDE = DIVIDE(SUM('Table'[Column1]), SUM('Table'[Column2]))Column1 / Column2 = SUM('Table'[Column1]) / SUM('Table'[Column2])For more information, please refer to:
https://docs.microsoft.com/dax/divide-function-dax
DIVIDE function vs. divide operator (/)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.