Search code examples
powerbidaxdata-analysispowerbi-desktopmeasure

Wrong growth rate


you can see the value of growth when -1 divided 0

I'm currently working on calculating the growth rate in Power BI using DAX programming, but I've hit a snag. Unfortunately, I'm having trouble with -1 divided by zero and it's giving me an incorrect calculation. I was wondering if anyone could lend a hand and help me fix this error. Thanks in advance!

Code: Sales growth = CALCULATE([2024]-[2023])/[2023]


Solution

  • Try using divide function instead:

    Sales growth = ROUND([2024]-[2023],0)/ROUND([2023],0)