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

Next 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

Reply
Anonymous
Not applicable

How to create subcategory

Hello,

 

modeloperatingSystem
HoloLensWindows
UC-EngineWindows
UC-EngineWindows

 

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!

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

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,

vyalanwumsft_0-1645514872174.png

The final output is shown below:

vyalanwumsft_1-1645514895247.png

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.

View solution in original post

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

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,

vyalanwumsft_0-1645514872174.png

The final output is shown below:

vyalanwumsft_1-1645514895247.png

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.

mh2587
Super User
Super User

You can do this in PQ


✔ Answered? Mark as solution

Muhammad Hasnain | Super User • Fabric • Power BI • Data Engineering

Let's connect on LinkedIn
Anonymous
Not applicable

What do I have to do?

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.