Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
I am trying to replicate this SQL query in Power BI power query.
Solved! Go to Solution.
Paste the code below into the Advanced Editor. The magic happens at the #"Add New Column" step.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtQzMtQzMHTUqwACXXMDAyUdpQBfEwOl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [WBS = _t, #"Task Name" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"WBS", type text}, {"Task Name", type text}}),
#"Add New Column" = Table.AddColumn(#"Changed Type","New Column",
each Text.BeforeDelimiter([WBS],"xxxx") & [Task Name] & Text.AfterDelimiter([WBS],"xxxx"), type text)
in
#"Add New Column"
See also the Add Custom Column:
Paste the code below into the Advanced Editor. The magic happens at the #"Add New Column" step.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtQzMtQzMHTUqwACXXMDAyUdpQBfEwOl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [WBS = _t, #"Task Name" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"WBS", type text}, {"Task Name", type text}}),
#"Add New Column" = Table.AddColumn(#"Changed Type","New Column",
each Text.BeforeDelimiter([WBS],"xxxx") & [Task Name] & Text.AfterDelimiter([WBS],"xxxx"), type text)
in
#"Add New Column"
See also the Add Custom Column:
Thank you very much @ronrsnfld worked great!!!!
Wow alot more to it than i thought the SQL syntax is much easier.
I appreciate your help.
You can use syntax similar to SQL:
Text.Replace([WBS],"xxxx","Task Name")
However, using the diagnostic tools available in Power BI, that syntax runs considerably slower than the more complicated version I presented.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
14 | |
13 | |
12 | |
12 | |
12 |