Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
I have table with two columns in a table for with values as 0.31 and 0.12. I to show need 0.31 as 31% which mutiplied by 100. I need to change this only for StockB where it exists in the table. How to do it in Power any idea is welcome.
| Name | Value |
| StockB | 0.31 |
| StockC | 0.12 |
| StockD | 6.99 |
| StockE | 20.99 |
Output:
| Name | Value |
| StockB | 31% |
| StockC | 0.12 |
| StockD | 6.99 |
| StockE | 20.99 |
Hello - you can do it like this:
Table.AddColumn(#"Changed Type", "Custom", each if [Name] = "StockB" then [Value]*100 else [Value])
I need to do this query as new custom column? I tried but it is not working that way it showing as expand table.
How to do this multiple coulmns?
The example above is to add a new column with the expected result. If you want to replace the value in the existing column, you could do it like this:
Table.ReplaceValue(Custom1, each [Value],each if [Name] = "StockB" then [Value]*100 else [Value],Replacer.ReplaceValue,{"Value"})
Here is the complete script which includes both scenarios.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCi7JT852UtJRMtAzNlSK1YGKOINFDI0QIi5AETM9S0uEiCtQxMgALBQLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Value", type number}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if [Name] = "StockB" then [Value]*100 else [Value]),
Custom1 = #"Added Custom",
#"Replaced Value" = Table.ReplaceValue(Custom1, each [Value],each if [Name] = "StockB" then [Value]*100 else [Value],Replacer.ReplaceValue,{"Value"})
in
#"Replaced Value"
If you will post a copy of your script I can try to identify why you would be getting the option to expand values. It is most likely something in your script.
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 5 | |
| 5 | |
| 4 |