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
abadill
Resolver I
Resolver I

Contabilizar información de columnas diferentes

Hola buenas noches,

 

Por favor alguien que me pueda ayudar con esta consulta. En la siguiente data manejo información de proyectos y cada proyecto tiene identificado riesgos, los cuales se han segmentado en Tipo de riesgo 1, Detalle de riesgo 1 y responsable de riesgo 1. El mismo criterio se aplica cuando queremos registrar el 2do riesgo.

 

Pregunta: Cómo puedo contar estos riesgos en un tablero. Cómo puedo cuantificar el detalle de esos riesgos y sus responsables, dado que manejo varias columnas de información .

 

Saludos

Andrea

 

PROYECTOTIPO RIESGO 1DETALLE RIESGO 1RESP RIESGO 1TIPO RIESGO 2DETALLE RIESGO 2RESP RIESGO 2
AAANOVEDAD_PREVENTAFALTA CONTRATO FIRMADOCOMNOVEDAD_PREVENTANOVEDADES EN DISEÑO-HLDC&D
BBBNOVEDAD_PLANIFICACIONRETRASO EN EJECUCION DE CRONOGRAMAPMOCAMBIOS_ALCANCECLIENTE SOLICITA AJUSTES AL ALCANCECOM
CCCNOVEDAD_DESPLIEGUERETRASO X TRABAJOS/OBRA CIVIL CLIENTECLIENTENOVEDAD_COMPRASRETRASO X FALTA DE COTIZACION/AFC&D
4 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hola

Los datos se deben transformar tal y como se muestra en de la imagen de abajo. Este código M provoca la transformación

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bZDBasNADER/Rew5Jd8ga2Vbye7KWa3tFBNCoYUGSk75f+ptSfGh1xnNzEPL4hDR7VzSiT3665B54lSqFMVMUgcmXWIPpKlkpLI68+3x+X/Gc71+6YOHxLOtCsHb/R28u+wW1zTNNhYwSSuEJJp+sgFfQRJQnzVplzECn5nG8usPUWsfxkbUrhgIE3FVRisaOUPm08hWDNAfVi2uTAZFofQMRjrwE72yENGGZeUegnA38h/IGQ7a2J5kkgCz5iM8h+rm1+3j/tgUkMYho23SAekI2sJp1MJ7bLe/uHwD", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Project = _t, #"RISK TYPE 1" = _t, #"RISK DETAIL 1" = _t, #"RISK 1" = _t, #"RISK TYPE 2" = _t, #"RISK DETAIL 2" = _t, #"RISK 2" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Project", type text}, {"RISK TYPE 1", type text}, {"RISK DETAIL 1", type text}, {"RISK 1", type text}, {"RISK TYPE 2", type text}, {"RISK DETAIL 2", type text}, {"RISK 2", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Project"}, "Attribute", "Value"),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Unpivoted Other Columns", "Attribute", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, true), {"Attribute.1", "Attribute.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Attribute.1", type text}, {"Attribute.2", Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type1", List.Distinct(#"Changed Type1"[Attribute.1]), "Attribute.1", "Value"),
    #"Removed Columns" = Table.RemoveColumns(#"Pivoted Column",{"Attribute.2"})
in
    #"Removed Columns"

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

Hola

Realmente no sé cómo ayudarte. Usted sólo debe ser capaz de descargar el archivo y al hacer doble clic en él debe abrirse en PowerBI Desktop. También estoy adjuntando el archivo para su referencia.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

Hola @abadill

Ashish_Mathur archivo pbix funciona bien de mi lado, si usted podría utilizar esta manera para abrir el archivo en el escritorio power bi

File->Open->Browse y, a continuación, elija este archivo.

2.JPG

y para su requisito, necesita depivote y pivotar su tabla en la consulta de energía, aquí está el blog, por favor refiérase a él:

https://radacad.com/pivot-and-unpivot-with-power-bi

Saludos

Lin

Community Support Team _ Lin
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

Gracias si me sirvió.

View solution in original post

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hola

Los datos se deben transformar tal y como se muestra en de la imagen de abajo. Este código M provoca la transformación

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bZDBasNADER/Rew5Jd8ga2Vbye7KWa3tFBNCoYUGSk75f+ptSfGh1xnNzEPL4hDR7VzSiT3665B54lSqFMVMUgcmXWIPpKlkpLI68+3x+X/Gc71+6YOHxLOtCsHb/R28u+wW1zTNNhYwSSuEJJp+sgFfQRJQnzVplzECn5nG8usPUWsfxkbUrhgIE3FVRisaOUPm08hWDNAfVi2uTAZFofQMRjrwE72yENGGZeUegnA38h/IGQ7a2J5kkgCz5iM8h+rm1+3j/tgUkMYho23SAekI2sJp1MJ7bLe/uHwD", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Project = _t, #"RISK TYPE 1" = _t, #"RISK DETAIL 1" = _t, #"RISK 1" = _t, #"RISK TYPE 2" = _t, #"RISK DETAIL 2" = _t, #"RISK 2" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Project", type text}, {"RISK TYPE 1", type text}, {"RISK DETAIL 1", type text}, {"RISK 1", type text}, {"RISK TYPE 2", type text}, {"RISK DETAIL 2", type text}, {"RISK 2", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Project"}, "Attribute", "Value"),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Unpivoted Other Columns", "Attribute", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, true), {"Attribute.1", "Attribute.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Attribute.1", type text}, {"Attribute.2", Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type1", List.Distinct(#"Changed Type1"[Attribute.1]), "Attribute.1", "Value"),
    #"Removed Columns" = Table.RemoveColumns(#"Pivoted Column",{"Attribute.2"})
in
    #"Removed Columns"

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hola,

 

La solución que usted publico es exactamente lo que necesito pero al tratar de pasar el código me sale errores de sintaxis. Por favor me puede pasar el archivo , yo utilizo powerbi en español.   He estado haciendo varias modificaciones pero no doy con la solución. Me puede pasar a mi correo anbadi@uees.edu.ec o si me lo pasa por algun link no hay problema.

Hola

Puede descargar mi archivo PBI desde aquí.

Espero que esto ayude.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hola

 

No puedo abrirlo =(  cuando lo abro desde el winrar no me lo reconoce como un archivo de power bi. Que pena , disculpa la molestia será que me puede colcar el paso a paso, de como hacer ese cambio en las columnas.

 

Gracias

Andrea.

Gracias si me sirvió.

Hola @abadill

Ashish_Mathur archivo pbix funciona bien de mi lado, si usted podría utilizar esta manera para abrir el archivo en el escritorio power bi

File->Open->Browse y, a continuación, elija este archivo.

2.JPG

y para su requisito, necesita depivote y pivotar su tabla en la consulta de energía, aquí está el blog, por favor refiérase a él:

https://radacad.com/pivot-and-unpivot-with-power-bi

Saludos

Lin

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

Gracias si pude abrir el archivo y la solución si me funcionó.

Hola

Realmente no sé cómo ayudarte. Usted sólo debe ser capaz de descargar el archivo y al hacer doble clic en él debe abrirse en PowerBI Desktop. También estoy adjuntando el archivo para su referencia.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Me sale error de sintaxys. Esto es lo que estoy colocando. Me puede compartir el archivo de ejemplo.

 

= Table.TransformColumnTypes(#"Encabezados promovidos",{{"PROYECTO", type text}, {"TIPO RIESGO 1", type text}, {"DETALLE RIESGO 1", type text}, {"RESP RIESGO 1", type text}, {"TIPO RIESGO 2", type text}, {"DETALLE RIESGO 2", type text}, {"RESP RIESGO 2", type text}}), ,
#"Changed Type" = Table.TransformColumnTypes(#"Encabezados promovidos",{{"PROYECTO", type text}, {"TIPO RIESGO 1", type text}, {"DETALLE RIESGO 1", type text}, {"RESP RIESGO 1", type text}, {"TIPO RIESGO 2", type text}, {"DETALLE RIESGO 2", type text}, {"RESP RIESGO 2", type text}}), # Table.UnpivotOtherColumns (#"Tipo cambiado"{"PROYECTO"},"ATRIBUTO","VALOR"),# "Splitter.SplitTextByAnyDelimiter" = Table.SplitColumn (#"Unpivoted Other Columns", "ATRIBUTO", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, true), {"ATRIBUTO.1", "ATRIBUTO.2"}), #"Tipo cambiado1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"ATRIBUTO.1", type text}, {"ATRIBUTO.2", Int64.Type}}),
#"Pivoted Column" = Table.Pivot(#"Tipo cambiado1", List.Distinct(#"Tipo cambiado1"[ATRIBUTO.1]), "ATRIBUTO.1", "VALOR"),
#"Removed Columns" = Table.RemoveColumns(#"Pivoted Column",{"ATRIBUTO.2"})
in
#"Removed Columns"

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.