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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
kasfour
Helper I
Helper I

Average of a calculated measure

Hello everyone, 

I am trying to calculate the average of all services below 100%. Each month I have those services on the dashboard as shown below.

Is there a way to calculate the average and place it on a card.

 

Appreciate you help.

 

kasfour_0-1676752071241.png

 

8 REPLIES 8
tamerj1
Super User
Super User

Hi @kasfour 

you may try

Uptime =

AVERAGEX (

VALUES ( 'Date'[YearMonth] ),

CALCULATE (

VAR Uptime = 1-DIVIDE(SUM('Uptime YTD'[DOWNTIMEin minutes]),[DayDiff(Minutes)],0)
IF (

Uptime < 1, 

Uptime

)

)

)

 

Thank you @tamerj1 . The below error showed when trying to add this measure

 

kasfour_0-1676832715490.png

 

@kasfour 
The MonthYear column is from which table. Replace 'Table'[Column] below with the real name of that column

Uptime =
AVERAGEX (
    VALUES ( 'Table'[Column] ),
    CALCULATE (
        VAR Uptime =
            1 - DIVIDE ( SUM ( 'Uptime YTD'[DOWNTIMEin minutes] ), [DayDiff(Minutes)], 0 )
        RETURN
            IF ( Uptime < 1, Uptime )
    )
)

Thank you @tamerj1 . However the result is different than what I expected. The measure is called Avg. Uptime shown below. I expected the average to be taken from the services with lower than 100% only. In that example below the avg should have been (99.85+99.72+99.66)/3 = 99.74%

I guess the solution is close now :). Thank you so much for your help so far.

 

kasfour_0-1676879599850.png

 

@kasfour 
Sorry for the late response. I was stuck in a couple of meetings. 

Please help me try understand the column chart visual. Previously I thought it is sliced by YearMonth which means each column (bar) is a actually a month. Having 3 columns means that there are minimum 3 months building up the filter context, however I can see that the date slicer is showing the dates of only one month (2023-Jan). Would you please clarify this point.

kasfour
Helper I
Helper I

I measure the services uptime monthly using the below function

"Uptime = 1-DIVIDE(SUM('Uptime YTD'[DOWNTIMEin minutes]),[DayDiff(Minutes)],0)"

 

kasfour_0-1676812922635.png

 

kasfour
Helper I
Helper I

I measure the services uptime monthly using the below function

"Uptime = 1-DIVIDE(SUM('Uptime YTD'[DOWNTIMEin minutes]),[DayDiff(Minutes)],0)"

 

kasfour_0-1676803132643.png

 

FreemanZ
Super User
Super User

hi @kasfour 

The average of what measure?

Or what measure do you have in your lower bar chart? How is it defined? 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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