Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I am new to PBI, and I have a set of data with repetitive words in my title etc. 'abc - count of 123' is there a way to remove 'abc -' and leave 'count of 123'?
Solved! Go to Solution.
Hi @Anonymous ,
Thanks for your clarification!
To be honest, I first thought you wanted to change the data and not the title. There are not that many tools to change column titles in Power Query. Still, this is what I found:
Before:
After:
There is no "find text and substitute/remove" function for titles in Power Query. But you could go into the M code of the advanced editor and do the copy and pasting there. I imagine that could save you a bit of time:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTJVitWJVjICsszALGMgyxzMMgGyLJRiYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Deaths - Alzheimer's disease and other dementias Sex: Both - Age: All Ages (Number)" = _t, #"Deaths - Mengitis disease and other dementias Sex: Both - Age: All Ages (Number)" = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Deaths - Alzheimer's disease and other dementias Sex: Both - Age: All Ages (Number)", Int64.Type}, {"Deaths - Mengitis disease and other dementias Sex: Both - Age: All Ages (Number)", Int64.Type}}), #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{ {"Deaths - Alzheimer's disease and other dementias Sex: Both - Age: All Ages (Number)", "Alzheimer's disease and other dementias"}, {"Deaths - Mengitis disease and other dementias Sex: Both - Age: All Ages (Number)", "Mengitis disease and other dementias"} }) in #"Renamed Columns"
As you can see, you can specify the renaming of many columns in just one steep. Another option could also be to change the name of the columns in your source system, i.e. by aliasing them accordingly in a view.
Hope this helps! 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
Hi @tackytechtom!
Thanks for reaching out!
I want the titles to be 'Meningitis' and 'Alzheimer's disease and other dementias'. I have many columns like this in the dataset. So, Im looking for a way that helps me delete 'Deaths - ' and 'Sex: Both - Age: All Ages (Number)' from all the column titles at once.
Hi @Anonymous ,
Thanks for your clarification!
To be honest, I first thought you wanted to change the data and not the title. There are not that many tools to change column titles in Power Query. Still, this is what I found:
Before:
After:
There is no "find text and substitute/remove" function for titles in Power Query. But you could go into the M code of the advanced editor and do the copy and pasting there. I imagine that could save you a bit of time:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTJVitWJVjICsszALGMgyxzMMgGyLJRiYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Deaths - Alzheimer's disease and other dementias Sex: Both - Age: All Ages (Number)" = _t, #"Deaths - Mengitis disease and other dementias Sex: Both - Age: All Ages (Number)" = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Deaths - Alzheimer's disease and other dementias Sex: Both - Age: All Ages (Number)", Int64.Type}, {"Deaths - Mengitis disease and other dementias Sex: Both - Age: All Ages (Number)", Int64.Type}}), #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{ {"Deaths - Alzheimer's disease and other dementias Sex: Both - Age: All Ages (Number)", "Alzheimer's disease and other dementias"}, {"Deaths - Mengitis disease and other dementias Sex: Both - Age: All Ages (Number)", "Mengitis disease and other dementias"} }) in #"Renamed Columns"
As you can see, you can specify the renaming of many columns in just one steep. Another option could also be to change the name of the columns in your source system, i.e. by aliasing them accordingly in a view.
Hope this helps! 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
Hi @Anonymous ,
Please, could you share a screenshot of the data and what you exactly want to remove? There are different ways of doing this and I'd like to see what kind of cases appear in your data so you can solve this in a scalable manner 🙂
Thanks!
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
17 | |
9 | |
8 | |
7 | |
7 |