Reply
Leoca90
New Member
Partially syndicated - Outbound

Promedio ocupación por fechas y centros

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_ekonfechaocupacion_real
Centro 101/01/202332
Centro 101/01/202315
Centro 101/01/202310
Centro 101/02/202332
Centro 101/02/202314
Centro 201/01/202314
Centro 201/01/2023dieciséis
Centro 201/02/202310
Centro 201/02/20239
Centro 201/03/202310
Centro 201/03/20238

 

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

2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Syndicated - Outbound

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:

vcgaomsft_2-1701428770872.png

 

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

Syndicate_Admin
Administrator
Administrator

Source Community: Power Apps | Source Author Name: lbendlin
Syndicated - Inbound

what would be the expected result based on your sample data?

avatar user

Helpful resources

Announcements
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)