Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello,
| model | operatingSystem |
| HoloLens | Windows |
| UC-Engine | Windows |
| UC-Engine | Windows |
so if the model equals UC-Engine I would like to change the value of operatingSystem to something new.
How do I do this? I dont want to create a new column or table for that, just replace the values and leave all the other values where model is not UC-Engine.
Thank you very much!
Solved! Go to Solution.
Hi, @Anonymous ;
You could add a condtion column in power query then delete original column.
1.add new column.
= Table.AddColumn(#"Changed Type", "operatingSystem2", each if [model] = "UC-Engine" then "new" else [operatingSystem])
2.delete original column,
The final output is shown below:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8sjPyfdJzStW0lEKz8xLyS8vVorViVYKddZ1zUvPzEslRjwWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [model = _t, operatingSystem = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"model", type text}, {"operatingSystem", type text}}),
#"Added Conditional Column" = Table.AddColumn(#"Changed Type", "operatingSystem2", each if [model] = "UC-Engine" then "new" else [operatingSystem]),
#"Removed Columns" = Table.RemoveColumns(#"Added Conditional Column",{"operatingSystem"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"operatingSystem2", "operatingSystem"}})
in
#"Renamed Columns"
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous ;
You could add a condtion column in power query then delete original column.
1.add new column.
= Table.AddColumn(#"Changed Type", "operatingSystem2", each if [model] = "UC-Engine" then "new" else [operatingSystem])
2.delete original column,
The final output is shown below:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8sjPyfdJzStW0lEKz8xLyS8vVorViVYKddZ1zUvPzEslRjwWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [model = _t, operatingSystem = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"model", type text}, {"operatingSystem", type text}}),
#"Added Conditional Column" = Table.AddColumn(#"Changed Type", "operatingSystem2", each if [model] = "UC-Engine" then "new" else [operatingSystem]),
#"Removed Columns" = Table.RemoveColumns(#"Added Conditional Column",{"operatingSystem"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"operatingSystem2", "operatingSystem"}})
in
#"Renamed Columns"
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You can do this in PQ
What do I have to do?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 50 | |
| 44 | |
| 42 | |
| 19 | |
| 19 |
| User | Count |
|---|---|
| 69 | |
| 68 | |
| 33 | |
| 32 | |
| 32 |