Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
summer18
Helper III
Helper III

custom column in query editor

Hi,  I hope someone can help me on this.  I have screenshot below of my sample data.

1) How can I do in Query Editor to convert "0" to 1 in column B?  Because I tried adding Conditional column but other decimals like 0.000011 are being converted to 1 too?  I only wanted exactly 0 to be converted to 1

2) I have added Custom column in Query Editor because I want per row to divide A and B but I'm getting infinity if there's 0.  I would just like the result to be null or convert B column with exactly 0 to 1 so it will not result to infinity.  I tried "try .... otherwise" in custom column but it did not work. 

 

test1.JPG

 

2 REPLIES 2
olgad
Super User
Super User

@summer18 Have my answer or you have solved your problem? If so, can you please share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime
olgad
Super User
Super User

Hi, 
you can replace the value ∞ with null 

olgad_0-1674144018812.png

olgad_1-1674144054442.png

 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.