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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

0

How can I calculate average of total per month dax

I have this data per month, 

 

sjpbi_0-1729579396515.png

How can i caluclate average per month, it should be 22M something, cause when i straight average it will average all the data, i need is per month

Status: Delivered

Hi @sjpbi ,

 

Please follow the steps below to try it out:

1.Create a date table

DateTable = CALENDAR(MIN(YourTable[Date]), MAX(YourTable[Date]))

2.Add columns year and month

Year = YEAR(DateTable[Date])
Month = FORMAT(DateTable[Date], "MMM")

3.Create a relationship between the Date column in your data table and the Date column in your date table.

4.Create a Measure for Monthly Average

MonthlyAverage = AVERAGEX(
    SUMMARIZE(
        YourTable,
        DateTable[Year],
        DateTable[Month],
        "MonthlySum", SUM(YourTable[Value])
    ),
    [MonthlySum]
)

 

Best regards,
Community Support Team_ Scott Chang

Comments
v-tianyich-msft
Community Support
Status changed to: Delivered

Hi @sjpbi ,

 

Please follow the steps below to try it out:

1.Create a date table

DateTable = CALENDAR(MIN(YourTable[Date]), MAX(YourTable[Date]))

2.Add columns year and month

Year = YEAR(DateTable[Date])
Month = FORMAT(DateTable[Date], "MMM")

3.Create a relationship between the Date column in your data table and the Date column in your date table.

4.Create a Measure for Monthly Average

MonthlyAverage = AVERAGEX(
    SUMMARIZE(
        YourTable,
        DateTable[Year],
        DateTable[Month],
        "MonthlySum", SUM(YourTable[Value])
    ),
    [MonthlySum]
)

 

Best regards,
Community Support Team_ Scott Chang