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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Jase71ds
Advocate I
Advocate I

Convert "N" to 0, and "Y" to 1

 

I have a column [Overdue] that has only two values, either "Y" or "N".

I'd like to convert all "Y"s to 1 and all "N"s to 0.

My first thought was to go into Query Editor and use the wonderful feature; "Column From Examples" but it didn't work.

 

Can someone help me with, what in Excel, is essentially: =IF([Overdue]="Y", 1, 0)

 

Thanks!

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

in the QueryEditor add a custom colum and use this formula

if [Overdue] = "Y" then 1 else 0

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

3 REPLIES 3
TomMartens
Super User
Super User

Hey,

 

in the QueryEditor add a custom colum and use this formula

if [Overdue] = "Y" then 1 else 0

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Ah, thanks. That was easier than I was making it.

I had tried similar but thought that my IF THEN ELSE had to be in caps. It didn't work and I never thought to try lower case.

 

Thank you very much 🙂

I'm glad, that I was able to help. It's always the tiny things that are time consuming 😉



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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