Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
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.
Solved! Go to Solution.
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"})
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"})
That worked, thank you so much!
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.
Proud to be a Super User!
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
100 | |
65 | |
44 | |
36 | |
36 |