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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
julian_urrea
Frequent Visitor

Segregación RRHH

Hola a todos!!!

 

Estoy intentado crear el INDICE DE SEGREGACION OCUPACIONAL GENERAL el cual se debe medir por cargo, genero mes a mes  para esto me estoy basando en la siguiente tabla

julian_urrea_0-1712597664485.png


Esta es mi tabla de información

julian_urrea_2-1712597837444.png

 

Necesito construir las mismas métricas  y debo tener en cuenta que solo se miden aquellos cargos en que hay personal de los dos generos.

Les agradezco su colaboración.

1 ACCEPTED SOLUTION

Hi @julian_urrea ,

I apologize for misunderstanding you earlier, please do the following.

The Table data is shown below:

vzhouwenmsft_0-1712828520530.png

Please follow these steps:

1. Use the following DAX expression to create a table named 'Table2'

Table 2 = 
VAR _a = SUMMARIZE('Table','Table'[Cargo],'Table'[Fecha])
VAR _b = ADDCOLUMNS(_a,"A",IF(ISBLANK(CALCULATE(COUNT('Table'[Genero]),'Table'[Genero]  = "Masculino")),0,CALCULATE(COUNT('Table'[Genero]),'Table'[Genero]  = "Masculino")))
VAR _c = ADDCOLUMNS(_b,"B",IF(ISBLANK(CALCULATE(COUNT('Table'[Genero]),'Table'[Genero] = "Femenino")),0,CALCULATE(COUNT('Table'[Genero]),'Table'[Genero] = "Femenino")))
RETURN _c

2.Use the following DAX expression to create columns in 'Table2'

C = [A] +[B]
1A = [A]
2A = DIVIDE([1A],[C])

THO = 20

3A = DIVIDE([1A],20)
1B = [B]
2B = DIVIDE([1B],[C])

TMO = 50

3B = DIVIDE([1B],50)
4 = ABS([3A] - [3B])

 3.Use the following DAX expression to create a measure

Measure = DIVIDE(SUM('Table 2'[4]),2)

4.Final output

vzhouwenmsft_1-1712828983949.png

vzhouwenmsft_2-1712828994006.png

 

View solution in original post

7 REPLIES 7
v-zhouwen-msft
Community Support
Community Support

Hi @julian_urrea ,

The Table data is shown below:

vzhouwenmsft_0-1712654105430.png

Please follow these steps:

1. Use the following DAX expression to create a table

Table 2 = FILTER('Table',NOT ISBLANK('Table'[Genero]))

 2.Use the following DAX expression to create a measure

Hombre = 
VAR _a = CALCULATE(COUNT('Table 2'[Genero]),'Table 2'[Genero]  = "Masculino")
RETURN IF(ISBLANK(_a),0,_a)

3.Use the following DAX expression to create a measure

Mujer = 
VAR _a = CALCULATE(COUNT('Table 2'[Genero]),'Table 2'[Genero] = "Femenino")
RETURN IF(ISBLANK(_a),0,_a)

4.Use the following DAX expression to create a measure

Total = [Hombre] + [Mujer]

5.Use the following DAX expression to create a measure

ABSOLUTO Hombres = [Hombre]

6.Use the following DAX expression to create a measure

% hombres en el puesto = DIVIDE([ABSOLUTO Hombres],[Total],0)

 7.Use the following DAX expression to create a measure

ABSOLUTO Mujeres = [Mujer]

 8.Use the following DAX expression to create a measure

%Mujeres en el puesto = DIVIDE([ABSOLUTO Mujeres],[Total],0)

9.Final output

 

vzhouwenmsft_1-1712654414995.png

vzhouwenmsft_2-1712654430446.png


Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Buenas tardes @v-zhouwen-msft, primero que todo agradezco el tiempo que te tomaste para adyuarme con mi consulta.

Estuve revisando la solución que me ofreces y me genera error al tratar de mostrar la información por mes, ya realice las mismas metricas que me planteas y con eso busco obtener el último paso que es 4= ABS(3A-3B), al momento de mostrarlo por mes la formula pierde consistencia.

 

Adjunto una imagen de lo que me sale.

 

julian_urrea_0-1712693087121.png

 

 

 

Hi @julian_urrea ,

Regarding your question, if you use the date as the x-axis, you will first calculate the sum of column '3A' and the sum of column '3B' before proceeding with the calculation, i.e. ABS(1-1).

vzhouwenmsft_0-1712741246759.png

If you want to view data in multiple dimensions, i.e.,you can use a matrix.

vzhouwenmsft_1-1712741596807.png

vzhouwenmsft_2-1712741609685.png

If I'm misunderstanding, please provide the data and show the expected results in pictures.

Hola @v-zhouwen-msft.

 

En teoría debo presentar un gráfico de barras mensual o trimestral como muestro a continuación, este gráfico que te muestro es un ejemplo que me dieron hacia lo que debo llegar.

 

julian_urrea_0-1712751588034.png

Yo tengo una tabla de tiempo relacionada a mi tabla Base que es con la que trabajo la información principal del tablero. y cuanto con una informacion similar a la que te proporcioné

julian_urrea_5-1712754799251.png

Lo único que no te dije es que el calculo que se ve en el gráfico de barras es el resaltado en la siguiente imagen que esta en letra roja 

julian_urrea_6-1712754900838.png

Se calcula sacando el último paso 4= ABS(3A-3B)/2

El resultado que vez al final es la suma de las filas de 4=ABS(3A-3B)

julian_urrea_7-1712755589949.png

 

Hi @julian_urrea ,

I apologize for misunderstanding you earlier, please do the following.

The Table data is shown below:

vzhouwenmsft_0-1712828520530.png

Please follow these steps:

1. Use the following DAX expression to create a table named 'Table2'

Table 2 = 
VAR _a = SUMMARIZE('Table','Table'[Cargo],'Table'[Fecha])
VAR _b = ADDCOLUMNS(_a,"A",IF(ISBLANK(CALCULATE(COUNT('Table'[Genero]),'Table'[Genero]  = "Masculino")),0,CALCULATE(COUNT('Table'[Genero]),'Table'[Genero]  = "Masculino")))
VAR _c = ADDCOLUMNS(_b,"B",IF(ISBLANK(CALCULATE(COUNT('Table'[Genero]),'Table'[Genero] = "Femenino")),0,CALCULATE(COUNT('Table'[Genero]),'Table'[Genero] = "Femenino")))
RETURN _c

2.Use the following DAX expression to create columns in 'Table2'

C = [A] +[B]
1A = [A]
2A = DIVIDE([1A],[C])

THO = 20

3A = DIVIDE([1A],20)
1B = [B]
2B = DIVIDE([1B],[C])

TMO = 50

3B = DIVIDE([1B],50)
4 = ABS([3A] - [3B])

 3.Use the following DAX expression to create a measure

Measure = DIVIDE(SUM('Table 2'[4]),2)

4.Final output

vzhouwenmsft_1-1712828983949.png

vzhouwenmsft_2-1712828994006.png

 

Muchas gracias @v-zhouwen-msft, efectivamente esto era lo que necesitaba.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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