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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Syndicate_Admin
Administrator
Administrator

Para actualizar los nombres de las columnas dinámicamente en el nivel de cuadrícula.

Hola

Necesito ayuda con respecto a, tengo una tabla con las siguientes columnas,

Región, Territorio, CQM1 mes (enero), CQM2 mes (febrero), CQM3 mes (marzo), PQM1 mes (octubre), PQM2 mes (noviembre), PQM3 mes (diciembre). Esta tabla contiene datos agregados, pero aquí necesito mostrarlos dinámicamente para actualizar los encabezados de mes en el objeto visual de la cuadrícula. Salida esperada como Región, Territorio, Enero, Febrero, Marzo, Octubre, Noviembre, Diciembre como encabezados de columna basados en los meses futuros.

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

@Swathi1 la posible solución es anular la dinamización de la tabla y extraer el mes, pegar la siguiente consulta M en el editor avanzado y aplicar los mismos pasos en los datos.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WClLSUQoBYkMgNgJiYyA2AWJTIDZTio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Region = _t, Territory = _t, #"CQM1 Month (Jan)" = _t, #"CQM2 Month(February)" = _t, #"CQM3 Month (March)" = _t, #"PQM1 Month(Oct)" = _t, #"PQM2 Month (November)" = _t, #"PQM3 Month(December)" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Region", type text}, {"Territory", type text}, {"CQM1 Month (Jan)", type text}, {"CQM2 Month(February)", type text}, {"CQM3 Month (March)", type text}, {"PQM1 Month(Oct)", type text}, {"PQM2 Month (November)", type text}, {"PQM3 Month(December)", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Region", "Territory"}, "Attribute", "Value"),
    #"Added Custom" = Table.AddColumn(#"Unpivoted Other Columns", "Month", each Text.BetweenDelimiters([Attribute],"(",")"), type text),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Attribute"})
in
    #"Removed Columns"

Para visualizar, use el objeto visual de matriz, el mes en las columnas y el valor en la sección de valores del objeto visual de matriz.

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors