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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors
Top Kudoed Authors