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

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.

Reply
Syndicate_Admin
Administrator
Administrator

Filas divididas

Hola, me gustaría dividir ya sabes una serie de filas, Una fila debe dividirse tantas veces que el resultado en su fila es siempre 0.25. El salto de datos en una celda siempre es 0.25 por lo que 0.25 luego 0.5 y luego 0.75 hasta 12,

una fila tiene por ejemplo 0.5 en su columna, quiero dividirla en dos filas idénticas que tienen valores personalizados de 0.25

Mensaje de textovalor
ejemplo10,5

resultado

Mensaje de textovalorcustom_value
ejemplo10,50,25
ejemplo10,50,25


segundo ejemplo una fila tiene valor 4 Quiero que se divida en 8 filas

Mensaje de textovalor
ejemplo24

resultado

Mensaje de textovalorcustom_value
ejemplo240,25
ejemplo240,25
ejemplo240,25
ejemplo240,25
ejemplo240,25
ejemplo240,25
ejemplo240,25
ejemplo240,25

¿tienes idea de cómo hacer esto

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

No @wiktorius1984,

Tengo una pregunta sobre cómo calcular el número de filas sin embargo, el primer enfoque ya que siempre desea que el mismo valor haga lo siguiente:

  • Agregue una columna personalizada con el código siguiente:

Text.Start( Text.Repeat( Number.ToText(0.25) & "," , [Value]/0.25),

Text.Length(Text.Repeat( Number.ToText(0.25) & "," , [Value]/0.25))-1)

La única pregunta aquí es acerca de la última parte de la sintaxis que debe ser chjange para darle el número correcto de filas (sin entender por qué 4 le da un resultado de 8 filas).

  • Haga una columna dividida por filas:

MFelix_0-1620898419519.png

resultado final y código a continuación:

MFelix_1-1620898445196.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcq1IzC3ISTU0UNJRMtAzVYrVgYsZAYVMlGJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [text = _t, Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"text", type text}, {"Value", type number}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Start( Text.Repeat( Number.ToText(0.25) & "," , [Value]/0.25),

Text.Length(Text.Repeat( Number.ToText(0.25) & "," , [Value]/0.25))-1)),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Added Custom", {{"Custom", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Custom"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Custom", type number}})
in
    #"Changed Type1"

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

No @wiktorius1984,

Tengo una pregunta sobre cómo calcular el número de filas sin embargo, el primer enfoque ya que siempre desea que el mismo valor haga lo siguiente:

  • Agregue una columna personalizada con el código siguiente:

Text.Start( Text.Repeat( Number.ToText(0.25) & "," , [Value]/0.25),

Text.Length(Text.Repeat( Number.ToText(0.25) & "," , [Value]/0.25))-1)

La única pregunta aquí es acerca de la última parte de la sintaxis que debe ser chjange para darle el número correcto de filas (sin entender por qué 4 le da un resultado de 8 filas).

  • Haga una columna dividida por filas:

MFelix_0-1620898419519.png

resultado final y código a continuación:

MFelix_1-1620898445196.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcq1IzC3ISTU0UNJRMtAzVYrVgYsZAYVMlGJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [text = _t, Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"text", type text}, {"Value", type number}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Start( Text.Repeat( Number.ToText(0.25) & "," , [Value]/0.25),

Text.Length(Text.Repeat( Number.ToText(0.25) & "," , [Value]/0.25))-1)),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Added Custom", {{"Custom", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Custom"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Custom", type number}})
in
    #"Changed Type1"

gracias por la ayuda, usted tiene razón en caso de valor 4 debe haber 16 filas 🙂 thx

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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