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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
erhan_79
Post Prodigy
Post Prodigy

columna pivote

Hola;

Tiene una tabla como se muestra a continuación que está llamando a la tabla A , necesito pivotar esta tabla como segunda picture.i quería utilizar en la sección de columnas dinámicas del lado de la consulta, pero no pude hacer . ¿Podrías ayudarme a que también tenga sentido y crear fácilmente la muestra de sobresalto de mi mesa con el siguiente enlace

target-_blankhttps://drive.google.com/file/d/12zu0mFmix2bQjd-JHl4N3CTSDBUzPWGZ/view?usp-sharing

Mi mesa

Capture1.JPG

Quiero pivotar por encima de la tabla como abajo :

Capture2.JPG

gracias de antemano

1 REPLY 1
mahoneypat
Employee
Employee

Una opción sería mantener la tabla tal cual y simplemente escribir medidas para hacer cada una de las agregaciones. A continuación, puede hacer que una tabla sea visual con esas dos primeras columnas y las medidas para obtener el resultado deseado.

Sin embargo, si desea hacerlo en el editor de consultas, aquí hay una manera de hacerlo. Para ver cómo funciona, simplemente cree una consulta en blanco, vaya a Editor avanzado y reemplace el texto allí con el código M a continuación.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjTVMzDTMzIwMlDSUQooSi3LzC8tBjINDUACYal5KflFjkCWb2KJI1hYKVYHny5DdF1OSLoM9AzMYbock0tKE3PAkkZwPU5INpkSqccZocfIFO46bHpM0N0G0mpkgFePKVyPC0QPiDKG2GMEdJsFTI9fakUJWIcZum9cQToMyNERCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Order Date" = _t, #"Status Month" = _t, #"Order NO" = _t, #"Vendor Name" = _t, Material = _t, #"Order Qty" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Order Date", type text}, {"Status Month", type text}, {"Order NO", Int64.Type}, {"Vendor Name", type text}, {"Material", type text}, {"Order Qty", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Order Date", "Status Month"}, {{"OrderCount", each List.Count(List.Distinct([Order NO])), type nullable number}, {"VendorCount", each List.Count(List.Distinct([Vendor Name])), type nullable number}, {"MaterialCount", each List.Count(List.Distinct([Material])), type nullable number},{"TotalQty", each List.Sum([Order Qty]), Int64.Type}})
in
    #"Grouped Rows"

Si esto funciona para usted, márquelo como la solución. Los elogios también son apreciados. Por favor, avísame si no.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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