Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi all,
I need to create calculated column in power bi as below:
Column =(col1-col2)/col2
Will appreciate your help.
Solved! Go to Solution.
Hi @sdhn
try this:
Column =
IF (
[col2] = 0,
BLANK (),
IF ( [col1] - [col2] < 0, 0, ( [col1] - [col2] ) / [col2] )
)
If my posts helps, please consider accepting them as solutions to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Thanks, great help
Hi @sdhn
Can you share a sample of your data in a text format?
BTW, try this:
Column =([col1]-[col2])/[col2]
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
If both columns have "0" value output come as NaN
Column =([0]-[0])/[0]
output is "NaN"
in one row I have value for column 1 = 13
column 2 = 0
Column =([13]-[0])/[0]
Out put is infinity
Sum values come in new column come as "NaN" & in one row value of New Column is "Infinity". Rest rows are fine. Any advise Thanks
Try this:
Column =IF([col2]=0,blank(),([col1]-[col2])/[col2])
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Great , thi ssolve the issue. One more request.
I am getting negative figures in few rows.
as -0.3 %. I want to display any "-" as '0'. Can you help on this too? thanks
I meant Just display 0 if there is any negative "-" number
Hi @sdhn
try this:
Column =
IF (
[col2] = 0,
BLANK (),
IF ( [col1] - [col2] < 0, 0, ( [col1] - [col2] ) / [col2] )
)
If my posts helps, please consider accepting them as solutions to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 17 | |
| 13 | |
| 8 | |
| 4 | |
| 4 |