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.
Hola
Estoy tratando de crear un total a partir de varias columnas sin tener que pivotar dichas columnas.
Aquí hay una muestra de los datos;
Empleador | Sector Industrial | Sector Industrial 2 | Sector Industrial 3 | Categoría de tamaño del empleador | Número de cadetes contratados | Fecha de ejecución del contrato | Informe final de seguimiento recibido | Ejercicio financiero |
éhau NZ Limited | Medios de información y telecomunicaciones | 1 | 10/03/2020 | 5/10/2020 | 2019/20 | |||
Todo el área andamios limitados | Construcción | 3 | 17/06/2019 | 29/11/2019 | 2018/19 | |||
Broadspectrum (Nueva Zelanda) Limited | Servicios de electricidad, gas, agua y residuos | Construcción | Más de 50 | 15 | 2/07/2020 | 2020/21 | ||
Alliance Services Limited | Construcción | 2 | 9/02/2020 | 20/08/2020 | 2019/20 |
Estoy tratando de mostrar los totales de las tres columnas de la industria. Un ejemplo sería el total de contstructiones sería 3.
No puedo anular la pivote de las columnas porque estoy calculando la columna "Número de contratación de cadetes" para mostrar los totales de cada empleador, un pivoting crearía filas duplicadas y duplicaría los totales.
Cualquier ayuda estaría muy agradecida, abierta a otras opciones que pueden lograr el mismo resultado.
Gracias.
Solved! Go to Solution.
Hola @Ngars ,
Una pregunta con respecto al cálculo que necesita para lograr que está presentando en su ejemplo que el Total de Construcciones sería 3 es este el recuento de filas que tienen la Construcción en uno de los sectores de la Industria?
¿Cuál es el resultado que está tratando de lograr en los cálculos, es para ser utilizado en diferentes tipos de cálculos como SUM, AVERAGE, COUNT o a uno específico?
¿Y cómo desea que el filtro de valores sea por una sola columna o por todas las columnas que tenga?
He hecho un simple ejercicio haciendo un recuento de cada sector.
Industry =
FILTER (
DISTINCT (
UNION (
VALUES ( 'Table'[Industry Sector] );
VALUES ( 'Table'[Industry Sector 2] );
VALUES ( 'Table'[Industry Sector 3 ] )
)
);
'Table'[Industry Sector] <> BLANK ()
)
Ahora agregué la siguiente medida:
Count of industry =
VAR Industry_selection =
VALUES ( Industry[Industry Sector] )
VAR Industry_Count =
FILTER (
ALLSELECTED ( 'Table'[Industry Sector]; 'Table'[Employer] );
'Table'[Industry Sector] IN Industry_selection
)
VAR Industry_2_Count =
FILTER (
ALLSELECTED ( 'Table'[Industry Sector 2]; 'Table'[Employer] );
'Table'[Industry Sector 2] IN Industry_selection
)
VAR Industry_3_Count =
FILTER (
ALLSELECTED ( 'Table'[Industry Sector 3 ]; 'Table'[Employer] );
'Table'[Industry Sector 3 ] IN Industry_selection
)
RETURN
COUNTROWS ( Industry_Count ) + COUNTROWS ( Industry_2_Count )
+ COUNTROWS ( Industry_3_Count )
Como se puede ver a continuación tengo el recuento para cada industria correctamente:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHola @MFelix
Ok impresionante, gracias por eso! Con esa cortadora trabajando parece la solución a mi problema.
Ok, so creating a seperate table might not solve my issue and I also need the Idusries to be filtered by Financial Year.
Hola @Ngars ,
La tabla desconectada sólo está forzando que las 3 columnas se busquen para el campo comoon que es la industria, sin embargo, si nos fijamos en la parte de la fórmula donde tiene ALLSELECTED puede elegir agregar columnas adicionales con otros filtros en este caso agregue el FY:
Count of industry =
VAR Industry_selection =
VALUES ( Industry[Industry Sector] )
VAR Industry_Count =
FILTER (
ALLSELECTED ( 'Table'[Industry Sector], 'Table'[Employer] ,'Table'[Financial year]),
'Table'[Industry Sector] IN Industry_selection
)
VAR Industry_2_Count =
FILTER (
ALLSELECTED ( 'Table'[Industry Sector 2], 'Table'[Employer] , 'Table'[Financial year]),
'Table'[Industry Sector 2] IN Industry_selection
)
VAR Industry_3_Count =
FILTER (
ALLSELECTED ( 'Table'[Industry Sector 3 ], 'Table'[Employer] , 'Table'[Financial year]),
'Table'[Industry Sector 3 ] IN Industry_selection
)
RETURN
COUNTROWS ( Industry_Count ) + COUNTROWS ( Industry_2_Count )
+ COUNTROWS ( Industry_3_Count )
Tiene usted puede ver en el PBIX adjuntar también funciona en la cortadora FY.
Este es un problema de contexto y por lo que para aplicar el contexto puede agregar las columnas que necesita a los valores, he hecho este enfoque para tener el ALLSELECTED basado en diferentes columnas, pero también puede colocar el nombre de la tabla en su lugar, sin embargo esto puede causar problemas de rendimiento, pero el resultado debe ser similar.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsI also have a slicer that filters FY, will creating a seperate Industry table affect this?
The separate table should not affect any other values since it will only impact measures or visualizations where it's mentioned.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHola @Ngars ,
Una pregunta con respecto al cálculo que necesita para lograr que está presentando en su ejemplo que el Total de Construcciones sería 3 es este el recuento de filas que tienen la Construcción en uno de los sectores de la Industria?
¿Cuál es el resultado que está tratando de lograr en los cálculos, es para ser utilizado en diferentes tipos de cálculos como SUM, AVERAGE, COUNT o a uno específico?
¿Y cómo desea que el filtro de valores sea por una sola columna o por todas las columnas que tenga?
He hecho un simple ejercicio haciendo un recuento de cada sector.
Industry =
FILTER (
DISTINCT (
UNION (
VALUES ( 'Table'[Industry Sector] );
VALUES ( 'Table'[Industry Sector 2] );
VALUES ( 'Table'[Industry Sector 3 ] )
)
);
'Table'[Industry Sector] <> BLANK ()
)
Ahora agregué la siguiente medida:
Count of industry =
VAR Industry_selection =
VALUES ( Industry[Industry Sector] )
VAR Industry_Count =
FILTER (
ALLSELECTED ( 'Table'[Industry Sector]; 'Table'[Employer] );
'Table'[Industry Sector] IN Industry_selection
)
VAR Industry_2_Count =
FILTER (
ALLSELECTED ( 'Table'[Industry Sector 2]; 'Table'[Employer] );
'Table'[Industry Sector 2] IN Industry_selection
)
VAR Industry_3_Count =
FILTER (
ALLSELECTED ( 'Table'[Industry Sector 3 ]; 'Table'[Employer] );
'Table'[Industry Sector 3 ] IN Industry_selection
)
RETURN
COUNTROWS ( Industry_Count ) + COUNTROWS ( Industry_2_Count )
+ COUNTROWS ( Industry_3_Count )
Como se puede ver a continuación tengo el recuento para cada industria correctamente:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @MFelix,
The construction total is a count across all three industry columns. So twice in Industry Sector and once in Industry Sector 2.
The result im trying to achieve in a count of the Industry Values across the three industry columns and im also using a SUM to calculate the "Number of Cadets Contracted", hence why I couldnt use the up pivot method.
Your example looks like what I was trying to achieve. Ill have to run it in my main pbix file and see if it solves my issue.
Thanks
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |