Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
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?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.