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
olivierschelstr
Regular Visitor

Formato de datos de gráficos de barras apiladas semanas y volúmenes de día de la semana

Hola a todos

Estoy tratando de mostrar a mi empresa cuántos contenedores cargamos por semana, pero también divididos por día de la semana, en un gráfico de barras apiladas.

¿Cómo tengo que organizar mis datos? No parece funcionar para mí..

Idealmente veo todas las semanas en mi eje X, con el número de contenedores en el eje Y

-> Y en la barra apilada, la división entre los días de la semana

Gracias de antemano,

olivierschelstr_1-1604566854142.png

@stackedbarchart

3 REPLIES 3
amitchandak
Super User
Super User

@olivierschelstr , Estos datos necesitan alguna transformación. Puede pegarlo en formato de tabla.

@ImkeF, ¿cómo tratar estos datos? Semana están en una fila y luego los días de la semana

Column1 Containers
Monday 8
Tuesday 4
Wednessday 5
Thursday 7
Friday 6
Week 2 30
Monday 8
Tuesday 6
Wednessday 4
Thursday 11
Friday 10
Week 3 39
Monday 10
Tuesday 7
Wednessday 4
Thursday 6
Friday 9
Week 4 36
Monday 6
Tuesday 5
Wednessday 3
Thursday 7
Friday 7
Week 5 28
Monday 12
Tuesday 11
Wednessday 4
Thursday 13
Friday 7
Week 6 47

Hola @olivierschelstr ,

He creado un archivo pbix de ejemplo para usted con dos métodos diferentes, compruebe si son lo que desea.

1. Cree una tabla calculada con la siguiente fórmula y cree un gráfico de barras apiladas con nuevos campos de tabla

Table 2 = FILTER('Table',IFERROR(SEARCH("week",'Table'[Column 1]),0)>0)

2. Realice transformaciones para la tabla original: 1) agregue la columna de índice 2)datos de grupo 3)datos de filtro

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("jdC9CoMwEMDxVyk3O5ivi76AWzfBITgUDLQULCgOvr35OAiJiB3/l4QfOWPg+Zun1w4VNDBWBvrNrrFl6MFOs11ppOKV97bQQIdBt3xiIj2x3wd3KerQlwKeBVkKjOUEq5MhvNHmBp0nRP+BYG60iZCewJzAQlBnQdwsSidBueRN8QleELSFm1WJSwT9fdfjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Column 1" = _t, Containers = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column 1", type text}, {"Containers", Int64.Type}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1, Int64.Type),
    #"Inserted Integer-Division" = Table.AddColumn(#"Added Index", "Integer-Division", each Number.IntegerDivide([Index], 6), Int64.Type),
    #"Grouped Rows" = Table.Group(#"Inserted Integer-Division", {"Integer-Division"}, {{"Weeks", each List.Max([Column 1]), type nullable text}, {"Details", each _, type table [Column 1=nullable text, Containers=nullable number, Index=number, #"Integer-Division"=number]}}),
    #"Expanded Details" = Table.ExpandTableColumn(#"Grouped Rows", "Details", {"Column 1", "Containers"}, {"Column 1", "Containers"}),
    #"Filtered Rows" = Table.SelectRows(#"Expanded Details", each not Text.Contains([Column 1], "Week")),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Integer-Division"})
in
    #"Removed Columns"

Stacked bar chart data formatting weeks and weekday volumes.JPG

Saludos
Equipo de apoyo comunitario _ Rena Ruan
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más.

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.

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.