Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone,
I am new to power bi and i would like to know if there is any way to remove some words within the whole column?
For eg. The variables within the property row are:
I would like to remove the words "Entire", "Private room in", "Room in", "Shared room in"
Thank you very much in advance!
Solved! Go to Solution.
Here is another one...
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs0rySxKVUjOz0vJV4rViVYKKMosSyxJVSjKz89VyMxTSCxILCrJTc0rAcsGQUUz8ktSc8AiPvlpqFKoGoIzEotSU+Cm4bYHYWJIZl4lkFtanIpuAoZGpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [OldText = _t]),
Words = {"Entire", "Private room in", "Room in", "Shared room in"},
FINAL = Table.AddColumn(Source, "NewText", each
Text.Trim (List.Accumulate( {0..List.Count(Words)-1}, [OldText],
(s,c) => Text.Replace( s, Words{c}, "" ))))
in
FINAL
Here is another one...
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs0rySxKVUjOz0vJV4rViVYKKMosSyxJVSjKz89VyMxTSCxILCrJTc0rAcsGQUUz8ktSc8AiPvlpqFKoGoIzEotSU+Cm4bYHYWJIZl4lkFtanIpuAoZGpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [OldText = _t]),
Words = {"Entire", "Private room in", "Room in", "Shared room in"},
FINAL = Table.AddColumn(Source, "NewText", each
Text.Trim (List.Accumulate( {0..List.Count(Words)-1}, [OldText],
(s,c) => Text.Replace( s, Words{c}, "" ))))
in
FINAL
let
Kw = {"Entire", "Private room in", "Room in", "Shared room in"},
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs0rySxKVUjOz0vJV4rViVYKKMosSyxJVSjKz89VyMxTSCxILCrJTc0rAcsGQUUz8ktSc8AiPvlpqFKoGoIzEotSU+Cm4bYHYWJIZl4lkFtanIpuAoZGpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Type = _t]),
#"Added Custom" = Table.AddColumn(Source, "New", each List.Accumulate(Kw, [Type], (s,c) => let pos=Text.PositionOf(s,c,1,Comparer.OrdinalIgnoreCase) in if pos<>-1 then Text.Trim(Text.RemoveRange(s,pos,Text.Length(c))) else s))
in
#"Added Custom"
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.