Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I'm trying to say as long as text does not end with " 01" or " 02" then do a transformation, otherwise leave it as is but I get an error that I can't use not with text. Is there another way?
Solved! Go to Solution.
Here is a sample code that will do a transformation (takes the text before the " " delimiter) for all rows that do not end in " 01" or " 02".
Hope this helps point you in the right direction.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCk7MLchJVTAwVIrVQfCMUHjGKDwTFB5QXywA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Extracted Text Before Delimiter" = Table.TransformColumns(#"Changed Type", {{"Column1", each if not Text.EndsWith(_, " 01") and not Text.EndsWith(_, " 02") then Text.BeforeDelimiter(_, " ") else _, type text}})
in
#"Extracted Text Before Delimiter"
Proud to be a Super User! | |
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCk7MLchJVTAwVIrVQfCMUHjGKDwTFB5QXywA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"NOT Ends With" = Table.TransformColumns(Source, {"Column1", each if not List.Contains({"01","02"}, _, (x,y) => Text.EndsWith(y,x)) then "do sth with " & _ else _, type text})
in
#"NOT Ends With"
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
Here is a sample code that will do a transformation (takes the text before the " " delimiter) for all rows that do not end in " 01" or " 02".
Hope this helps point you in the right direction.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCk7MLchJVTAwVIrVQfCMUHjGKDwTFB5QXywA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Extracted Text Before Delimiter" = Table.TransformColumns(#"Changed Type", {{"Column1", each if not Text.EndsWith(_, " 01") and not Text.EndsWith(_, " 02") then Text.BeforeDelimiter(_, " ") else _, type text}})
in
#"Extracted Text Before Delimiter"
Proud to be a Super User! | |
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |