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
jesusssss
Helper II
Helper II

Issue with calculating month-to-month average using AVERAGE or AVERAGEX formula in Power BI

Hi there,

I'm having an issue and we are not able to create a measure to calculate the average of these month-to-month data. We are not sure what is happening when we use the average or averagex formula.

What I am trying to calculate is the sum of a column where we have different prices and then I want to calculate the month-to-month average of each data point, but I am not sure what it is calculating for me.

Measures: 17.1 Provider Cost Sum = SUM('17-Volume billing'[Provider Cost]) Average = AVERAGEX('17-Volume billing',[17.1 Provider Cost Sum])

jesusssss_0-1678865753923.png

Thanks.

 

1 ACCEPTED SOLUTION

@jesusssss 
Please try

Average =
VAR MaxDate =
    MAX ( Calendario[Date] )
VAR MinDate =
    CALCULATE ( MIN ( Calendario[Date] ), ALLSELECTED ( Calendario ) )
VAR DatesOnAndBefore =
    CALCULATETABLE (
        VALUES ( Calendario[Mes] ),
        Calendario[Date] <= MaxDate,
        Calendario[Date] >= MinDate,
        ALLSELECTED ()
    )
RETURN
    IF (
        [17.1 Provider Cost Sum] <> BLANK (),
        AVERAGEX ( DatesOnAndBefore, [17.1 Provider Cost Sum] )
    )

View solution in original post

26 REPLIES 26

I'll send you zoom meeting in a private message

@jesusssss 

What about Fecha table?

Perfect, it worked correctly. Thank you very much for everything.

aditya0125
Resolver I
Resolver I

Please Provide more info.

 

tamerj1
Super User
Super User

Hi @jesusssss 

please provide couple of examples 

Hi @tamerj1 and @aditya0125

In this Excel file, you can see the unit price data per month and then the average, which is what we would like to replicate in Power BI. The function in the Average cell is in Spanish but it is AVERAGE($B$6:D$6), and we replicated that function in the other cells.

jesusssss_0-1678874594720.png

In this image, you can see the column for which we want to calculate the average, which we achieved by creating a custom column that multiplies "quantity" by "net price."

jesusssss_1-1678874622207.png

As you can see, the average in the Excel table is not the same as the one I get when I use the AVERAGE function in Power BI, I hope this extra information has been helpful and that we can identify what the problem is. Thank you very much for your help.

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.