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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Promedio en powerbi

Buenas tardes, necesito ayuda con un problema en powerbi, cuento con la siguiente tabla

"cliente, fecha de visita"

Cli1, 01/01/2022

Cli1, 02/01/2022

Cli 2, 01/01/2022

Cli 2, 02/01/2022

Cli 2, 03/01/2022

Yo quiero mostrar en un dashboard el promedio mensual de visitas de mis clientes por lo que la tabla resultante seria

 

"Mes,promedio de visitas"

Enero , (2+3)/2=2,5

 

Hay alguna forma de calcular esto?

 

Muchas gracias

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Please try:

average =
CALCULATE (
    COUNTROWS ( 'Table' ) / DISTINCTCOUNT ( 'Table'[Client] ),
    FILTER (
        'Table',
        YEAR ( [date of visit] ) = YEAR ( MAX ( 'Table'[date of visit] ) )
            && MONTH ( [date of visit] ) = MONTH ( MAX ( 'Table'[date of visit] ) )
    )
)

Output:

Eyelyn9_0-1651215398966.png

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

Please try:

average =
CALCULATE (
    COUNTROWS ( 'Table' ) / DISTINCTCOUNT ( 'Table'[Client] ),
    FILTER (
        'Table',
        YEAR ( [date of visit] ) = YEAR ( MAX ( 'Table'[date of visit] ) )
            && MONTH ( [date of visit] ) = MONTH ( MAX ( 'Table'[date of visit] ) )
    )
)

Output:

Eyelyn9_0-1651215398966.png

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

amitchandak
Super User
Super User

@Anonymous , A measure like

 

AverageX(summarize(Table, Table[Client], "_sum", Count(Table[fecha de visita])), [_sum])

 

or add month year column in table and then have

 

Month Year = format(Table[fecha de visita], "YYYYMM")

 

 

measure =
AverageX(summarize(Table, Table[Client], Table[Month Year], "_sum", Count(Table[fecha de visita])), [_sum])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.