Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Syndicate_Admin
Administrator
Administrator

El texto de Power Query NO termina con

Estoy tratando de decir que siempre y cuando el texto no termine con "01" o "02", entonces haga una transformación, de lo contrario, déjelo como está, pero obtengo un error que no puedo usar no con texto. ¿Hay otra manera?

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

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"

ThxAlot_0-1703138971510.png

Syndicate_Admin
Administrator
Administrator

Aquí hay un código de ejemplo que hará una transformación (toma el texto antes del delimitador " ") para todas las filas que no terminan en " 01" o " 02".
Espero que esto te ayude a orientarte en la dirección correcta.

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"

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.