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
ch_01
New Member

Need to convert (Yes/No) to 1/0

Hi, 

 

I have a column Churn where the values are Yes/No need to be converted as 1 & 0 (Yes=1 , No=0).Screenshot (159).png  Can anyone assist me?

1 ACCEPTED SOLUTION
ribisht17
Super User
Super User

  Hi @ch_01 

 

Refer >> How to replace values in power bi (projectpro.io)

Step 1 - Select the data for replacing

Select the columns of the values you want to replace.

Step 2 - Select the Replace Values option

Right-click on the data set in the Fields pane, click on the edit query option. This will redirect us to Power Query Editor then follow the below steps -

Transform -> Replace Values button -> Replace Values Option

Replace Yes with 1 and No with 0

Step 3 - Insert Value to find(old) and value to Replace with(new)

After you click on the Replace Values option, a small window gets open where you can replace the old value with the new value.

Step 4 - Close and apply

Click on OK in the Replace Value window, it will replace the old value with the new value. Click on the Close & Apply button in order to apply all changes.

 

Regards,

Ritesh

@ch_01

View solution in original post

2 REPLIES 2
ribisht17
Super User
Super User

  Hi @ch_01 

 

Refer >> How to replace values in power bi (projectpro.io)

Step 1 - Select the data for replacing

Select the columns of the values you want to replace.

Step 2 - Select the Replace Values option

Right-click on the data set in the Fields pane, click on the edit query option. This will redirect us to Power Query Editor then follow the below steps -

Transform -> Replace Values button -> Replace Values Option

Replace Yes with 1 and No with 0

Step 3 - Insert Value to find(old) and value to Replace with(new)

After you click on the Replace Values option, a small window gets open where you can replace the old value with the new value.

Step 4 - Close and apply

Click on OK in the Replace Value window, it will replace the old value with the new value. Click on the Close & Apply button in order to apply all changes.

 

Regards,

Ritesh

@ch_01

Thank you

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.