Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Quick Question,
I'm currently conducting a Profit Margin calculation where our company has costs associated with no sales on the same day. Thus, our Profit turns into a negative number for that day. I'm attempting to calculate the Profit Margin for that day but am getting an "-Infinity" result, I'm guessing from a 'divide by zero' error. Here is my formula, very simple:
ProfitMargin = Test_Sales[Profit]/Test_Sales[Revenue]
I've changed the formatting to percentage in BI Modeling etc. Just not sure where to go from here.
Solved! Go to Solution.
This seems like a good scenario for DIVIDE, which lets you account for divide by zero errors.. Like this:
ProfitMargin = DIVIDE(Test_Sales[Profit,Test_Sales[Revenue],0)
Hi @juhayes,
As chrisu have mentioned above, you should use DIVIDE Function (DAX) to perform the division in this scenario.
Regards
Hi @juhayes,
As chrisu have mentioned above, you should use DIVIDE Function (DAX) to perform the division in this scenario.
Regards
This seems like a good scenario for DIVIDE, which lets you account for divide by zero errors.. Like this:
ProfitMargin = DIVIDE(Test_Sales[Profit,Test_Sales[Revenue],0)