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
Anonymous
Not applicable

Transformación de PowerQuery

Hola a todos

Me gustaría saber si esta transformación es posible en PowerQuery o DAX.1.png

1 ACCEPTED SOLUTION
nandic
Memorable Member
Memorable Member

Puede hacerlo en Power Query:
1) seleccione la primera columna (col 1) > transformar > columnas despivot > despivo otras columnas
2) agrupar por > avanzado > agrupar por col 1, valor > agregado predeterminado (filas de recuento)

Vaya al escritorio de Power BI:
1) crear tabulación cruzada: col 1 en filas, valor en columnas, contar en valores.
* Nota: puede cambiar el nombre de estas columnas como desee.

20200922 group by.PNG20200922 group by result.PNG

View solution in original post

2 REPLIES 2
FrankAT
Community Champion
Community Champion

Hola @Raja26

puede hacerlo con Power Query de la siguiente manera:

// Table
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnRU0lGKhONYHdxCflAhP7CQkxNUyI+gUCRcM0jI2ZmgUCwA", 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]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Col 1", type text}, {"Col 2", type text}, {"Col 3", type text}, {"Col 4", type text}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Col 1"}, "Attribute", "Value"),
    #"Grouped Rows" = Table.Group(#"Unpivoted Columns", {"Col 1", "Value"}, {{"Count", each Table.RowCount(_), Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Grouped Rows", List.Distinct(#"Grouped Rows"[Value]), "Value", "Count", List.Sum)
in
    #"Pivoted Column"

22-09-_2020_11-32-42.png

Con saludos amables desde la ciudad donde la leyenda del 'Pied Piper de Hamelin' está en casa
FrankAT (Orgulloso de ser un Datanaut)

nandic
Memorable Member
Memorable Member

Puede hacerlo en Power Query:
1) seleccione la primera columna (col 1) > transformar > columnas despivot > despivo otras columnas
2) agrupar por > avanzado > agrupar por col 1, valor > agregado predeterminado (filas de recuento)

Vaya al escritorio de Power BI:
1) crear tabulación cruzada: col 1 en filas, valor en columnas, contar en valores.
* Nota: puede cambiar el nombre de estas columnas como desee.

20200922 group by.PNG20200922 group by result.PNG

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.