This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
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())
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 25 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 61 | |
| 49 | |
| 28 | |
| 23 | |
| 23 |