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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Syndicate_Admin
Administrator
Administrator

Cómo combinar omitir las celdas NULL

Esto puede ser simple, pero soy bastante nuevo en M/DAX. Tengo un conjunto de datos como el siguiente. Quiero fusionar las columnas pero cuando hago eso con un Delimeter o Space o etc., se está dando ese carácter incluso si las celdas son nulas.

Estoy fusionando todas estas columnas y el resultado viene como ABC|| BCD| EFG||| GHI||

Quiero que la salida de merge sea ABC| BCD| EFG| GHI ignorando las celdas nulas.

Repollo 1Repollo 2Repollo 3Repollo 4Repollo 5Repollo 6Repollo 7Repollo 8Repollo 9Repollo 10Repollo 11
abecedario Bcd EFG grabar
1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

@BI_Analyticz

Primero combine las columnas seleccionadas y luego, vaya a los códigos de la Nueva columna y agregue lo siguiente:

Text.Combine(List.Select(
{[Col 1], [Col 2], [Col 3], [Col 4], [Col 5], [Col 6], [Col 7], [Col 8], [Col 9]},each _<>""), "|")

Pegue el código siguiente en una nueva consulta en blanco en el editor avanzado y compruebe el paso.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnRyVtJRAiInZxcIw9XNHcKAIHcPT6VYnWgQszglrTgFRBcXg0mIgnIgLoIwK5ViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Col 1" = _t, #"Col 2" = _t, #"Col 3" = _t, #"Col 4" = _t, #"Col 5" = _t, #"Col 6" = _t, #"Col 7" = _t, #"Col 8" = _t, #"Col 9" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Col 1", type text}, {"Col 2", type text}, {"Col 3", type text}, {"Col 4", type text}, {"Col 5", type text}, {"Col 6", type text}, {"Col 7", type text}, {"Col 8", type text}, {"Col 9", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each  Text.Combine(List.Select(
{[Col 1], [Col 2], [Col 3], [Col 4], [Col 5], [Col 6], [Col 7], [Col 8], [Col 9]},each _<>""), "|"))
in
    #"Added Custom"

Fowmy_0-1622720393431.png


View solution in original post

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

@BI_Analyticz

Primero combine las columnas seleccionadas y luego, vaya a los códigos de la Nueva columna y agregue lo siguiente:

Text.Combine(List.Select(
{[Col 1], [Col 2], [Col 3], [Col 4], [Col 5], [Col 6], [Col 7], [Col 8], [Col 9]},each _<>""), "|")

Pegue el código siguiente en una nueva consulta en blanco en el editor avanzado y compruebe el paso.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnRyVtJRAiInZxcIw9XNHcKAIHcPT6VYnWgQszglrTgFRBcXg0mIgnIgLoIwK5ViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Col 1" = _t, #"Col 2" = _t, #"Col 3" = _t, #"Col 4" = _t, #"Col 5" = _t, #"Col 6" = _t, #"Col 7" = _t, #"Col 8" = _t, #"Col 9" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Col 1", type text}, {"Col 2", type text}, {"Col 3", type text}, {"Col 4", type text}, {"Col 5", type text}, {"Col 6", type text}, {"Col 7", type text}, {"Col 8", type text}, {"Col 9", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each  Text.Combine(List.Select(
{[Col 1], [Col 2], [Col 3], [Col 4], [Col 5], [Col 6], [Col 7], [Col 8], [Col 9]},each _<>""), "|"))
in
    #"Added Custom"

Fowmy_0-1622720393431.png


No, este post es diferente. Solo quiero combinar columnas pero excluyendo celdas nulas. ¿Cómo puedo hacer eso? Por favor, ayuda a @CNENFRNL

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Kudoed Authors