Forum Discussion
sdhn
4 years agoResponsive Resident
Calculated Column
Hi all, I need to create calculated column in power bi as below: Column =(col1-col2)/col2 Will appreciate your help.
- 4 years ago
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/
sdhn
4 years agoResponsive Resident
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
sdhn
4 years agoResponsive Resident
I meant Just display 0 if there is any negative "-" number
- VahidDM4 years agoSuper User
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/