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 moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
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 |
|---|---|
| 37 | |
| 32 | |
| 27 | |
| 24 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 50 | |
| 31 | |
| 26 | |
| 22 |