Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have two columns....Proposed Budget and Proposed Costs. I am trying to calculate the gross margin % using this formula:
(Proposed Budget - Proposed Costs) / Proposed Budget
However, there are rows where Proposed Budget and Proposed Costs have values of 0. And when 0 is divided by 0, I am getting a NaN error.
What would be the correct syntax to only calculate this formula ONLY when Proposed Budget > 0?
Thanks!
Solved! Go to Solution.
hi, try using Divide Function
Result=Divide(Table1[Proposed Budget]- Table1[Proposed Costs], Table1[Proposed Budget],Blank())
You can also use IF([Proposed Budget] > 0, ([Proposed Budget] -[Proposed Costs]) / [Proposed Budget]). This will return a blank if the condition is false.
The solution above is nice and clean though.
You can also use IF([Proposed Budget] > 0, ([Proposed Budget] -[Proposed Costs]) / [Proposed Budget]). This will return a blank if the condition is false.
The solution above is nice and clean though.
hi, try using Divide Function
Result=Divide(Table1[Proposed Budget]- Table1[Proposed Costs], Table1[Proposed Budget],Blank())
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
101 | |
84 | |
79 | |
69 |
User | Count |
---|---|
120 | |
110 | |
95 | |
82 | |
77 |