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
Vialle_Diego
Frequent Visitor

DAX - Average by sum of different values

Hello, I need to find the average of the column [Delivery Time] by the distinct sum of the column [Index Count]:

 

Medida = CALCULATE(
    AVERAGEX(
        VALUES(dCalendario[Data]),
    CALCULATE(DISTINCTCOUNT(fPedidos[Índice])
    )))

Vialle_Diego_0-1658954553487.png

 

1 ACCEPTED SOLUTION

I found the solution, thanks.

Média dias de entrega = 
VAR Qnt_Entregas =
    DISTINCTCOUNT ( fPedidos[Índice] )
VAR Soma_Dias_Entrega =
    SUMX (
        VALUES ( fPedidos[Índice] ),
        CALCULATE ( AVERAGE ( fPedidos[Tempo de Entrega] ) )
    )
RETURN
    DIVIDE ( Soma_Dias_Entrega, Qnt_Entregas )

 

Vialle_Diego_0-1659018759261.png

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Vialle_Diego , that depends on visual column

 

Medida = CALCULATE(
AVERAGEX(
VALUES(dCalendario[State]),
CALCULATE(DISTINCTCOUNT(fPedidos[Índice])
)))

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

I found the solution, thanks.

Média dias de entrega = 
VAR Qnt_Entregas =
    DISTINCTCOUNT ( fPedidos[Índice] )
VAR Soma_Dias_Entrega =
    SUMX (
        VALUES ( fPedidos[Índice] ),
        CALCULATE ( AVERAGE ( fPedidos[Tempo de Entrega] ) )
    )
RETURN
    DIVIDE ( Soma_Dias_Entrega, Qnt_Entregas )

 

Vialle_Diego_0-1659018759261.png

 

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.