This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
I am trying to change the subdivision name from "Asset Management" to "Land Use Office" for those items where the the department is "land use office" I can't figure out the query editor language, see below. Everything works great up to the "Replaced LandUse", mainly because everything else is done straight throught the basic user interface edits.
------
let
Source =
#"Use First Row As Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Change Type" = Table.TransformColumnTypes(#"Use First Row As Headers",{{"EmplID", type text}, {"Name", type text}, {"District", type text}, {"Subdivision Code", Int64.Type}, {"Subdivision Name", type text}, {"FileDate", type datetime}}),
#"Filtered Rows" = Table.SelectRows(#"Change Type", each ([District] <> "")),
#"Changed Type" = Table.TransformColumnTypes(#"Filtered Rows",{{"EmplID", Int64.Type}, {"FileDate", type date}}),
#"Replaced CDP" = Table.ReplaceValue(#"Changed Type","Learning Center","Core Development Program",Replacer.ReplaceText,{"Subdivision Name"}),
#"Replaced ACO" = Table.ReplaceValue(#"Replaced CDP","Audit","Assurance & Compliance Office",Replacer.ReplaceText,{"Subdivision Name"}),
#"Replaced OTP3" = Table.ReplaceValue(#"Replaced ACO","PPTA","Office of Transportation Public-Private Partnerships",Replacer.ReplaceText,{"Subdivision Name"}),
#"Replaced LandUse" = Table.ReplaceValue(#"if({"Department", type text}="Land Use Office" then Table.ReplaceValue(#"Replaced OTP3", "Asset Management", "Land Use Office",Replacer.ReplaceText,{"Subdivision Name"}) else {"Subdivision Name"}="Asset Management")")
in
#"Replaced LandUse"
Solved! Go to Solution.
We ended up just adding a custom calculated column to do make the adjustment. See text below. To make it a little cleaner, we will add the other replace value steps into the custom calculated colum.
#"Added Custom" = Table.AddColumn(#"Replaced OTP3", "Res", each if [Department] = "Land Use Office" then "Land Use Office" else [Subdivision Name]),
We ended up just adding a custom calculated column to do make the adjustment. See text below. To make it a little cleaner, we will add the other replace value steps into the custom calculated colum.
#"Added Custom" = Table.AddColumn(#"Replaced OTP3", "Res", each if [Department] = "Land Use Office" then "Land Use Office" else [Subdivision Name]),
Check out the May 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 |
|---|---|
| 32 | |
| 26 | |
| 25 | |
| 24 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 48 | |
| 27 | |
| 23 | |
| 20 |