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

Necesita ayuda para la vista de matriz

Hola miembros de la comunidad,

Necesito su ayuda para buiId una vista de matriz que se muestra como: para el objetivo g1

añoEneroFebreroMarzoAbrilMayoJunioJulioAgostoSeptiembreOctubreNoviembreDiciembreYTDObjetivo
2020 13 5 6 91114 1416
2019 12 4 5 6 8 1011121313151515

Lo intenté, pero muestra el objetivo para cada mes que es indeseable.

aquí el YTD es el actual_score para el último mes o mes-2 y

el destino es el valor de la columna de destino donde mes-2 o puede ser el promedio del objetivo para todos los meses.

Por favor, ayúdame a resolver esto.

Gracias

Arundhati

Mis datos de demostración son tan

añomonthidGolPuntuaciónTomado
2020-2g11416
20201g1116
20202g1316
20203g1516
20204g1616
20205g1916
20206g11116
20207g11416
2019-2g11515
20191g1115
20192g1215
20193g1415
20194g1515
20195g1615
20196g1815
20197g11015
20198g11115
20199g11215
201910g11315
201911g11315
201912g11515
2020-2g210.211
20201g21.111
20202g22.311
20203g24.511
20204g2511
20205g26.111
20206g28.111
20207g210.211
2019-2g21011
20191g21.311
20192g22.311
20193g23.511
20194g25.711
20195g2611
20196g26.411
20197g27.311
20198g28.111
20199g28.411
201910g2911
201911g29.111
201912g21011
1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hola @arundhatid04 ,

Puede realizar transformaciones en Power Query Editor:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fdJLFoMgDAXQvTC2HBL+a/E47v53UIUSxAdOMugVyEuz74oNG7WpD5/lS2chd5Wgjk2QxIDkmAWyjTyQaxSAfKMMFKQN7CPO26c8ZvO13HDMNpAcYyDJ5oAkG74l2QKQZEtAPZoBS+NIBsti2H+5qqJFpDdcDPO2ReU5o7le9dyj8rMmQDnK2gLahk57QNcQyTcKkxdDwzTBuEpyWymWP4VgpWpMC7iK2dfqQjvG7ItVYuoI2IMCScygHaDEjJN20mJAfb0q4rV1v/j/2cNkPnlyLeFkjx8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [year = _t, monthid = _t, goal = _t, score = _t, taget = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"year", Int64.Type}, {"monthid", Int64.Type}, {"goal", type text}, {"score", type number}, {"taget", Int64.Type}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([goal] = "g1")),
    #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Filtered Rows", {{"monthid", type text}}, "zh-CN"), List.Distinct(Table.TransformColumnTypes(#"Filtered Rows", {{"monthid", type text}}, "zh-CN")[monthid]), "monthid", "score", List.Sum),
    #"Renamed Columns" = Table.RenameColumns(#"Pivoted Column",{{"-2", "YTD"}}),
    #"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"goal"}),
    #"Reordered Columns" = Table.ReorderColumns(#"Removed Columns",{"year", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "YTD", "taget"}),
    #"Sorted Rows" = Table.Sort(#"Reordered Columns",{{"year", Order.Descending}})
in
    #"Sorted Rows"

make transformations.JPG

Saludos

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yiruan-msft
Community Support
Community Support

Hola @arundhatid04 ,

Puede realizar transformaciones en Power Query Editor:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fdJLFoMgDAXQvTC2HBL+a/E47v53UIUSxAdOMugVyEuz74oNG7WpD5/lS2chd5Wgjk2QxIDkmAWyjTyQaxSAfKMMFKQN7CPO26c8ZvO13HDMNpAcYyDJ5oAkG74l2QKQZEtAPZoBS+NIBsti2H+5qqJFpDdcDPO2ReU5o7le9dyj8rMmQDnK2gLahk57QNcQyTcKkxdDwzTBuEpyWymWP4VgpWpMC7iK2dfqQjvG7ItVYuoI2IMCScygHaDEjJN20mJAfb0q4rV1v/j/2cNkPnlyLeFkjx8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [year = _t, monthid = _t, goal = _t, score = _t, taget = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"year", Int64.Type}, {"monthid", Int64.Type}, {"goal", type text}, {"score", type number}, {"taget", Int64.Type}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([goal] = "g1")),
    #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Filtered Rows", {{"monthid", type text}}, "zh-CN"), List.Distinct(Table.TransformColumnTypes(#"Filtered Rows", {{"monthid", type text}}, "zh-CN")[monthid]), "monthid", "score", List.Sum),
    #"Renamed Columns" = Table.RenameColumns(#"Pivoted Column",{{"-2", "YTD"}}),
    #"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"goal"}),
    #"Reordered Columns" = Table.ReorderColumns(#"Removed Columns",{"year", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "YTD", "taget"}),
    #"Sorted Rows" = Table.Sort(#"Reordered Columns",{{"year", Order.Descending}})
in
    #"Sorted Rows"

make transformations.JPG

Saludos

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hola @arundhatid04
Puede utilizar esta medida sobre los valores en el objeto visual de matriz.

Target = 
SWITCH(
    TRUE()
    , ISINSCOPE('Table'[monthid]), SUM('Table'[score])
    , MAX('Table'[taget])
)

A continuación, cambie Etiqueta de subtotal de columna a Destino.

Apreciado con Kudos.

Marque como solución si esto resuelve su problema.

Gracias

andre
Memorable Member
Memorable Member

debe crear una tabla con estos valores en una sola columna:

EneroFebreroMarzoAbrilMayoJunioJulioAgostoSeptiembreOctubreNoviembreDiciembreYTDObjetivo

ese colum de esa tabla entrará en las columnas de la matriz. a continuación, debe escribir un nuevo calc inteligente que examine el valor de la columna y luego calcule el valor adecuado para la celda. por lo que tendría una instrucción switch() con 14 condiciones diferentes para comprobar.

amitchandak
Super User
Super User

@arundhatid04 , Usted tiene que está utilizando alguna tabla calculada. La tabla híbrida no es posible a partir de ahora.

Creé una idea, votar por eso. https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/39773011-hybrid-table

Hybrid.png

Anonymous
Not applicable

Hola Amit,

¿Puede compartir el archivo .pbix para obtener más información.

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.