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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Nazish
Helper I
Helper I

How To Calculate Monthly Average for number of days?

Hi,

I have one coulmn of open days and closthing month and year in seperate columns and I want to calculate the the monthly averge open days in power bi. Can you help how I can do that?

Nazish_2-1659107275067.png

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Nazish , Based on what I got. You need a month Year column

 

AverageX(Values(Table[Month year]), calculate(Sum(Table[Open Days])) )

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

View solution in original post

v-zhangti
Community Support
Community Support

Hi, @Nazish 

 

You can try the following methods.

Column:

Average =
CALCULATE (
    AVERAGE ( 'Table'[OpenedDays] ),
    FILTER (
        'Table',
        [Closed Month] = EARLIER ( 'Table'[Closed Month] )
            && [Closed Year] = EARLIER ( 'Table'[Closed Year] )
    )
)

vzhangti_0-1659422726643.png

Measure:

Average M =
CALCULATE (
    AVERAGE ( 'Table'[OpenedDays] ),
    FILTER (
        ALL ( 'Table' ),
        [Closed Month] = SELECTEDVALUE ( 'Table'[Closed Month] )
            && [Closed Year] = SELECTEDVALUE ( 'Table'[Closed Year] )
    )
)

vzhangti_1-1659422910367.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

4 REPLIES 4
v-zhangti
Community Support
Community Support

Hi, @Nazish 

 

You can try the following methods.

Column:

Average =
CALCULATE (
    AVERAGE ( 'Table'[OpenedDays] ),
    FILTER (
        'Table',
        [Closed Month] = EARLIER ( 'Table'[Closed Month] )
            && [Closed Year] = EARLIER ( 'Table'[Closed Year] )
    )
)

vzhangti_0-1659422726643.png

Measure:

Average M =
CALCULATE (
    AVERAGE ( 'Table'[OpenedDays] ),
    FILTER (
        ALL ( 'Table' ),
        [Closed Month] = SELECTEDVALUE ( 'Table'[Closed Month] )
            && [Closed Year] = SELECTEDVALUE ( 'Table'[Closed Year] )
    )
)

vzhangti_1-1659422910367.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

Hi Community Team,

Yes that works, I was looking for the same output.

Thankyou.

 

amitchandak
Super User
Super User

@Nazish , Based on what I got. You need a month Year column

 

AverageX(Values(Table[Month year]), calculate(Sum(Table[Open Days])) )

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

@amitchandak So you mean I need to get Month year column first and then use below query?

How I can get Month Year Column? they are right now in 2 different columns.

Thanks.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors