Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hola a tod@s,
Necesito calcular el promedio de ocupación de una serie de centros teniendo por fecha filtrada. Es decir, necesito saber la ocupación media por centro contando el número de días que he filtrado.
centro_ekon | fecha | ocupacion_real |
Centro 1 | 01/01/2023 | 32 |
Centro 1 | 01/01/2023 | 15 |
Centro 1 | 01/01/2023 | 10 |
Centro 1 | 01/02/2023 | 32 |
Centro 1 | 01/02/2023 | 14 |
Centro 2 | 01/01/2023 | 14 |
Centro 2 | 01/01/2023 | dieciséis |
Centro 2 | 01/02/2023 | 10 |
Centro 2 | 01/02/2023 | 9 |
Centro 2 | 01/03/2023 | 10 |
Centro 2 | 01/03/2023 | 8 |
No sé si con la función valor promedio podría hacerse o hay otra forma con divide sumx, nº de días inicio y fin
Agradecería mucha la ayuda. un saludo
Hi @Leoca90 ,
Please try this measure:
average occupancy =
DIVIDE (
SUMX (
SUMMARIZE (
'Table',
'Table'[centro_ekon],
'Table'[fecha],
"average",
CALCULATE (
AVERAGE ( 'Table'[ocupacion_real] ),
'Table'[fecha] = EARLIER ( 'Table'[fecha] )
)
),
[average]
),
COUNTROWS ( 'Calendar' )
)
Output:
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
what would be the expected result based on your sample data?