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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Anonymous
Not applicable

Changing values above 1 to 0

Hi there! 

 

I have a table with one column where all values should be 1 or less than 1. However, there are quite a lot of values above that and I was wondering if there was a way I could change this easily.

1 ACCEPTED SOLUTION
ahmedoye
Responsive Resident
Responsive Resident

You can change this in Power Query using the suggestion below: If it works for you, kindly mark this as solution so anyone with similar issues can easily find it.

Step 1: Rightclick on the column in Power Query and Select Replace Values
Step 2: In the replace values dialog box, replace 1 with 0. You will have something like the below
           Table.ReplaceValue(#"Changed Type",1,0,Replacer.ReplaceValue,{"Item"})
Step 3: From the above code, go into the PowerQuery formula bar and replace the 1 with the below
            (each if [Item] >1 then [Item] else 0). Then you will have something like the below:
Table.ReplaceValue(#"Changed Type",(each if [Item] >1 then [Item] else 0) ,0,Replacer.ReplaceValue,{"Item"})


View solution in original post

3 REPLIES 3
ahmedoye
Responsive Resident
Responsive Resident

You can change this in Power Query using the suggestion below: If it works for you, kindly mark this as solution so anyone with similar issues can easily find it.

Step 1: Rightclick on the column in Power Query and Select Replace Values
Step 2: In the replace values dialog box, replace 1 with 0. You will have something like the below
           Table.ReplaceValue(#"Changed Type",1,0,Replacer.ReplaceValue,{"Item"})
Step 3: From the above code, go into the PowerQuery formula bar and replace the 1 with the below
            (each if [Item] >1 then [Item] else 0). Then you will have something like the below:
Table.ReplaceValue(#"Changed Type",(each if [Item] >1 then [Item] else 0) ,0,Replacer.ReplaceValue,{"Item"})


Anonymous
Not applicable

That worked, thank you so much!

vanessafvg
Super User
Super User

you chould change the values to an if statement.

 

can you provide more information such as what does your table look like, what is the rule one needs to apply?  ie how yo you know which value to convert it to.

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors