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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
V_M_0451
New Member

Estado del informe de personal por semana

Hola, soy un poco principiante a PBI y estoy tratando de averiguar cómo hacer algo útil a partir de nuestros informes de personal.

Tengo una hoja de cálculo maestra de cada equipo con una columna de nombres de personal, luego un coumn para cada semana con los valores en el que hay un estado de lo que esa persona estaba haciendo esa semana (en licencia, enfermo, redistribuido, etc.). Estos valores varían un poco de un equipo a un equipo, por lo que probablemente necesitaré una columna auxiliar para estandarizarlos. También he tomado todas las hojas maestras de equipo separadas y las he fusionado todas en una sola con el nombre del equipo en otra columna.

Lo que tengo la intención de hacer es mostrar esto en PBI de tal manera que pueda ver cuántas veces los estados a la semana, cómo eso cambia con el tiempo, y una manera de comparar entre equipos (ya sea una segmentación o una obtención de detalles a otra página tal vez). Hasta ahora, sin embargo, PBI parece resistente a usar las semanas como un eje (probablemente, ya que son sólo encabezados con otros valores a continuación. He intentado hacer columnas auxiliares con esa fecha abajo cada semana junto a ese estado, pero creo que es posible que deba consolidarlas todas en una sola columna larga con todas las fechas que se ejecutan de arriba a abajo, todos los estados de una columna junto a ellos y también los nombres de equipo. ¿Un poco más desordenado como una hoja de cálculo, pero PBI podría leerlo más fácilmente?

Siento que me falta una solución más elegante. Cualquier orientación sería apreciada!

4 REPLIES 4
BA_Pete
Super User
Super User

Hola @V_M_0451 ,

Estás pensando en la línea correcta. Esto realmente debe hacerse en Power Query de la siguiente manera:

Su hoja de departamento 1:

// jTable1 - example of dept spreadsheet
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("tVfBbsIwDP2XnjnEbmI3RzbEmAS7MgnxB2i3/f+SUqZSuTRt7UOMqoRX+9l+cS+XKjhHXG2q8/7wwn6dd/927Mzb88HrpgWP9Urw7VHGZmAX0vP754hZ6DNDTWhFiG/YrSVk3HNXY5wEXJxKoEz3Vlh9yOGe5Cc6xklPSnwW0xfrNn3CevLzONgUsShCAdZwT8xNZK8EhY6aSWrG6OtFP5LlrAbf3dKrTQixsSr8JDNoBs4OWW5Zpa6KPb5XdFWGavqpW1FhgLSkWIdU3LGSTk/W4xLbZZ6jmqdJO9Lz6WPE9P+0P02Ye6diq0V6iDX4Nt65KizH65HVuHMhR3oQVv/8q70HFiEHUvMrRDWsGNqmWC0yErj30Tfdy1cnFruRTiFoQgSzaYgMZTvJoTdzPIkazBvjhoUvTy4zqS67FUCeCXU4Rp2WkC/1YDcqp2tXnesk9wSWXDszOtJFNc11iRW7PFrS4upgBU4ugNL8n/z0JZ8lRVBA+U4r+/AtwuMc5c/v7Wb581Blm1q4/gE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Ref No." = _t, #"30/03/2020" = _t, #"31/03/2020" = _t, #"01/04/2020" = _t, #"02/04/2020" = _t, #"03/04/2020" = _t, #"04/04/2020" = _t, #"05/04/2020" = _t, #"06/04/2020" = _t, #"07/04/2020" = _t, #"08/04/2020" = _t, #"09/04/2020" = _t, #"10/04/2020" = _t, #"11/04/2020" = _t, #"12/04/2020" = _t]),
    chgAllTypes = Table.TransformColumnTypes(Source,{{"Ref No.", type text}, {"30/03/2020", type text}, {"31/03/2020", type text}, {"01/04/2020", type text}, {"02/04/2020", type text}, {"03/04/2020", type text}, {"04/04/2020", type text}, {"05/04/2020", type text}, {"06/04/2020", type text}, {"07/04/2020", type text}, {"08/04/2020", type text}, {"09/04/2020", type text}, {"10/04/2020", type text}, {"11/04/2020", type text}, {"12/04/2020", type text}})
in
    chgAllTypes

Su hoja de cálculo de departamento 2:

// jTable2 - example of dept spreadsheet
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("tVbJbsMgEP2VyuceZgEGjmmqNJWaXqwqhyh/EPXW/6+Js9mBBJzJYQYZhuc3MAubTePIeGpem+/1e6fXI+ln02tvy4HB9nXToHgO3ffs63EsQww8idi8vVARStCQ6T7jVPvykIpwFpAj3Pwzo+56+vu32x2HnqBDmzAuOrYxmAVAmQo2vANBa11cXixv6AFoxibjdvCTmV6DGRY9rsODIEcUFC9IvJ7bHFAPLAQYncalzWm4RE4aHIb0X4DklI7VEhEcu2CfGZcgoBiXFAtstlpUqGP1UUuaLhTdiZyCq9aplTEh9LH+tz+tsu4TmkkxB0lIC8wAgtNjFmxktvrIqGpENor0HANOBhtVaM8Qi8pTyj8KSgzsWUJqWyqgcaNtw83XK2OrJGz3jitgOF5LNn0BuBUzZ7VY3VGHgrX3WOPwsGudmXg5SpGHwYMOo64TWcxA5RgmYBiCLamcBc45CiQTnDtLH0+yr745IjlS/UyKFlgueUGVeAghlMR6UTayz72eKgLKoUGj45xQH+IKziFbn2N1Xw7PA67pkjcvTYr6RlH6kguZI6rIOUciNQ+zW3Dbfw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Ref No." = _t, #"30/03/2020" = _t, #"31/03/2020" = _t, #"01/04/2020" = _t, #"02/04/2020" = _t, #"03/04/2020" = _t, #"04/04/2020" = _t, #"05/04/2020" = _t, #"06/04/2020" = _t, #"07/04/2020" = _t, #"08/04/2020" = _t, #"09/04/2020" = _t, #"10/04/2020" = _t, #"11/04/2020" = _t, #"12/04/2020" = _t]),
    chgAllTypes = Table.TransformColumnTypes(Source,{{"Ref No.", type text}, {"30/03/2020", type text}, {"31/03/2020", type text}, {"01/04/2020", type text}, {"02/04/2020", type text}, {"03/04/2020", type text}, {"04/04/2020", type text}, {"05/04/2020", type text}, {"06/04/2020", type text}, {"07/04/2020", type text}, {"08/04/2020", type text}, {"09/04/2020", type text}, {"10/04/2020", type text}, {"11/04/2020", type text}, {"12/04/2020", type text}})
in
    chgAllTypes

Consulta principal, anexada y transformada:

// jTable
let
    Source = Table.Combine({jTable1, jTable2}),
    unpivotOtherCols = Table.UnpivotOtherColumns(Source, {"Ref No."}, "Attribute", "Value"),
    renCols = Table.RenameColumns(unpivotOtherCols,{{"Attribute", "workDate"}, {"Value", "workStatus"}})
in
    renCols

1. Vaya a Power Query > Nueva fuente > Consulta en blanco, luego vaya a Editor avanzado y pegue el primer código. Llame a esta consulta jTable1.

2. Siga el paso 1 de nuevo, pero usando el segundo código. Llama a este jTable2.

3. Lo mismo de nuevo, pero ahora con la tercera sección de código. Ahora verá todos los pasos que tomé para anexar las "hojas de cálculo de dept" juntas, y despivolas en una estructura de tabla utilizable para sus requisitos.

Obviamente, donde tengo [Ref No.] tendrás el nombre del empleado, y donde tengo las columnas de fecha, la tuya serán semanas, pero los principios y pasos serán los mismos.



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Exactamente lo que tenía en mente. 😊

Ejemplo muy útil, ¡muchas gracias!

Hola @V_M_0451 ,

No hay problema, feliz de que haya ayudado.

Por favor, marque mi respuesta como la solución si se hace lo que necesitaba.

Gracias



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Hola @V_M_0451 ,

Si encuentra @BA_Pete respuesta como solución, acéyétela como tal.






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors