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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Dividir columna por delimitador mediante una condición de valor diferente

Hola a todos

Tengo datos como la tabla siguiente quiero "Dividir columna por delimitador" mediante el uso de diferentes condiciones de valor

Ex:

If Category ( Category ) UPI (Categoría) - UPI , dividir por "/" y los tres primeros valores

Si la categoría es NEFT, luego Dividir por "-" & último valor

If Category - Cargos, divida por ": " & último valor

Screenshot_13.png

Datos:

CategoríaEntrada
UpiUPI/02451574525388/15:09:43/UPI/AAAA
UpiUPI/02451457297497/14:50:49/UPI/XXXXXX
NeftNEFT-282414563872-AAAA
NeftNEFT-206721296-BBBBBB
CargosCargos por pago al cliente pord:460297250
CargosCargos por pago al cliente pord:460297244

Gracias

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@vengadeshpalani

Pegue el código siguiente en el Editor avanzado de una consulta en blanco y compruebe el paso:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("nY49D4IwEIb/CuksaTnuWtpNURMWJUYTDWFgqLgAho+Bf2+pbjr5DPeRe5/kioKl1Wjrrp/ZimXtcxpZuSrYJc/c7ioXgBSRQgKKk4RHZIQ2GPPldvP8EpAUaIVa8QgNCYPaC1ePFw67/dkZSwshAXSKjBMF4frNd0hIBRFoGW48PpA+qr62g8t8puDe9UF+PG2DdBrGrrFuq+bGtmNgUAr3FJD4W0VkZfkC", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    AddColumn = Table.AddColumn(#"Promoted Headers", "Extracted", each 
    if [Category] = "UPI" then
    Text.BeforeDelimiter([Input], "/", {1, RelativePosition.FromEnd}) else if [Category] = "NEFT" then
    Text.AfterDelimiter([Input], "-", 1) else if [Category] = "Charges" then
    Text.AfterDelimiter([Input], ":") else null)
in
   AddColumn

Fowmy_0-1604318490581.png

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
Fowmy
Super User
Super User

@vengadeshpalani

Pegue el código siguiente en el Editor avanzado de una consulta en blanco y compruebe el paso:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("nY49D4IwEIb/CuksaTnuWtpNURMWJUYTDWFgqLgAho+Bf2+pbjr5DPeRe5/kioKl1Wjrrp/ZimXtcxpZuSrYJc/c7ioXgBSRQgKKk4RHZIQ2GPPldvP8EpAUaIVa8QgNCYPaC1ePFw67/dkZSwshAXSKjBMF4frNd0hIBRFoGW48PpA+qr62g8t8puDe9UF+PG2DdBrGrrFuq+bGtmNgUAr3FJD4W0VkZfkC", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    AddColumn = Table.AddColumn(#"Promoted Headers", "Extracted", each 
    if [Category] = "UPI" then
    Text.BeforeDelimiter([Input], "/", {1, RelativePosition.FromEnd}) else if [Category] = "NEFT" then
    Text.AfterDelimiter([Input], "-", 1) else if [Category] = "Charges" then
    Text.AfterDelimiter([Input], ":") else null)
in
   AddColumn

Fowmy_0-1604318490581.png

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Intente usar ejemplos de formulario de columna en Power Query. Hice datos de muestra y funciona.

amitchandak
Super User
Super User

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors