This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hello,
how can it posible to replace the numeric data to string? requirement is the value "-1" in Column Min and Max to be replaced by "N/A"
Thanks in advance
Solved! Go to Solution.
Hi @Gaddam ,
You can create a custom column that is "N/A" if the value of the base column is equal to -1, otherwise it is the current value of the base column. You can then delete the base column and rename the new column.
You can click "Advanced Editor" to copy and paste the following code and check the steps in the right step bar.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WctZ1NlDSUdI1BBJGSrE6YBFDmAiQgAoZwYRMzWBCxkCeoYEBQlmgbiBIBUjEEiYA0mcKEjE1VYqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Min = _t, Max = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Min", Int64.Type}, {"Max", Int64.Type}}),
#"Added Conditional Column" = Table.AddColumn(#"Changed Type", "_Min", each if [Min] = -1 then "N/A" else [Min]),
#"Added Conditional Column1" = Table.AddColumn(#"Added Conditional Column", "_Max", each if [Max] = -1 then "N/A" else [Max]),
#"Removed Columns" = Table.RemoveColumns(#"Added Conditional Column1",{"Min", "Max"})
in
#"Removed Columns"
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
You should avoid doing that because that will give rise to multiple data types in those columns. If you really do not want to see the -1, then replace them with null in the Query Editor.
Hi,
You should avoid doing that because that will give rise to multiple data types in those columns. If you really do not want to see the -1, then replace them with null in the Query Editor.
Hi @Gaddam ,
You can create a custom column that is "N/A" if the value of the base column is equal to -1, otherwise it is the current value of the base column. You can then delete the base column and rename the new column.
You can click "Advanced Editor" to copy and paste the following code and check the steps in the right step bar.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WctZ1NlDSUdI1BBJGSrE6YBFDmAiQgAoZwYRMzWBCxkCeoYEBQlmgbiBIBUjEEiYA0mcKEjE1VYqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Min = _t, Max = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Min", Int64.Type}, {"Max", Int64.Type}}),
#"Added Conditional Column" = Table.AddColumn(#"Changed Type", "_Min", each if [Min] = -1 then "N/A" else [Min]),
#"Added Conditional Column1" = Table.AddColumn(#"Added Conditional Column", "_Max", each if [Max] = -1 then "N/A" else [Max]),
#"Removed Columns" = Table.RemoveColumns(#"Added Conditional Column1",{"Min", "Max"})
in
#"Removed Columns"
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
thank you for your time and solution
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 35 | |
| 32 | |
| 25 | |
| 23 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 50 | |
| 30 | |
| 24 | |
| 23 |