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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Syndicate_Admin
Administrator
Administrator

¿Es posible combinar 2 columnas en 1 (creando nuevas filas)?

Tengo informes enviados automáticamente por correo electrónico desde el servidor de mi empresa. Actualmente realizo la transformación en Excel, pero estoy buscando obtener la configuración del proceso en PowerBI para la automatización.

Mi problema es que los informes se envían en este formato, y no puedo cambiarlos:
Nombre: Tipo 1 Tipo 2 Tipo 3

Me gustaría usar una consulta en BI para transformar los datos a esto:
Nombre: Tipo 1
Nombre: Tipo 2
Nombre: Tipo 3

No he podido encontrar un alma en ninguna parte de esto. Las columnas pivotantes y no pivotantes no hacen lo que estoy tratando de hacer.
Estoy tratando de fusionar todas mis columnas 'Tipo' en una sola columna, esencialmente agregándolas como filas adicionales a una columna existente.
¿Es esto posible en PowerBI? Cualquier sugerencia sería muy apreciada!

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

@Cottswald ,

Creé un archivo pbix de muestra (ver el archivo adjunto), verifique si eso es lo que desea.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("RcqhDcNAEETRXg4b5GZnbFfhBqwDAYFh6V+Rviwteejd97je389rjm38JgoLjZljbU8UEYWFxqhjEVFYaEx1NBGFhca4Y4goLDQmHXciCguN2TseRBQWGnN0PIkoLDTmHGv9AQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, #"Type 1" = _t, #"Type 2" = _t, #"Type 3" = _t, #"Type 4" = _t, #"Type 5" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Type 1", type text}, {"Type 2", type text}, {"Type 3", type text}, {"Type 4", type text}, {"Type 5", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Name"}, "Types", "Value"),
    #"Merged Columns" = Table.CombineColumns(#"Unpivoted Other Columns",{"Name", "Types"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged")
in
    #"Merged Columns"

yingyinr_0-1675839837106.png

Saludos

Syndicate_Admin
Administrator
Administrator

@Cottswald

¿Intenta pegar algunos datos ficticios pero concretos?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.