cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Syndicate_Admin
Administrator
Administrator

M idioma Valor máximo

¡hola!

Tengo una columna "Texto después del delimeter" que muestra 3 valores - 20, 21 y B. Quiero agregar otra columna en el Editor de consultas que si el valor es B, en su lugar debe mostrar cuál es el valor máximo de la columna "Texto después del delimeter".

¡Agradecería la ayuda!

opexx.JPG

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

No @newgirl,

puedes hacerlo así:

06-05-_2021_16-12-06.png

// Table
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjJQitUBUoZgygnCQWIbWirFxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Text After Delimiter" = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Only numbers", each try Number.From([Text After Delimiter]) otherwise null),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Insert Max", each if [Only numbers] <> null then [Only numbers] else List.Max(#"Added Custom"[Only numbers])),
    #"Changed Type" = Table.TransformColumnTypes(#"Added Custom1",{{"Only numbers", type number}, {"Insert Max", type number}})
in
    #"Changed Type"

Con amables saludos desde la ciudad donde la leyenda del 'Pied Piper de Hamelin' está en casa
FrankAT (Orgulloso de ser un Datanaut)

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

No @newgirl,

puedes hacerlo así:

06-05-_2021_16-12-06.png

// Table
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjJQitUBUoZgygnCQWIbWirFxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Text After Delimiter" = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Only numbers", each try Number.From([Text After Delimiter]) otherwise null),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Insert Max", each if [Only numbers] <> null then [Only numbers] else List.Max(#"Added Custom"[Only numbers])),
    #"Changed Type" = Table.TransformColumnTypes(#"Added Custom1",{{"Only numbers", type number}, {"Insert Max", type number}})
in
    #"Changed Type"

Con amables saludos desde la ciudad donde la leyenda del 'Pied Piper de Hamelin' está en casa
FrankAT (Orgulloso de ser un Datanaut)

View solution in original post

¡Muchas gracias! ¡Esto funcionó!

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Top Solution Authors
Top Kudoed Authors