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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Raj007
Helper III
Helper III

Average is incorrect.... between the bar graph average line and the average shown in card

Hi,

Could someone please provide some insights.. i have a very simple measure like - Total Duration is a value that includes the numbers in hours like 3.4, 2.6 etc
Average_Total_Duration=
VAR TD= AVERAGE('Testing'[Total Duration)
Retrun TD
when i look at the data - I see something is wrong mith the number that is shown in the bar graph average line and the average that is shown in the card and the table

In the below screen shot i have a bar chart with the average measure and also i have the average line that is based on the same measure - but the table is showing 17.9 which is the value at the Total line - this is wrong because the average of those 3 numbers is 14.6 - the one in the bar graph is correct
when i calculate the average not sure why i am getting 17.9 - i have the same set of filters - visual level fitlers on both the bar graph and table - but the average shown in the table is not right - any help please


IMG_0765.jpg

1 ACCEPTED SOLUTION

Hi Owen, thank you so much for your help and time. I really appreciate your explanation on what is going on between the 2 calculations -  in the below calculation first we calculate the CALCULATE ( AVERAGE ( 'Testing'[Total Duration] ) ) this gives me the same result which gives me the same result as table 17.9 
then for each unique value in the release we are calculating the average using the average x function

Average_Total_Duration=
VAR TD =
AVERAGEX (
VALUES ( 'Testing'[Release] ),
CALCULATE ( AVERAGE ( 'Testing'[Total Duration] ) )
)
RETURN
TD


thanks a lot

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hi @Raj007 

The reason for the difference is that there are two different calculations happening here:

  1. The Average Line created in the Analytics Pane calculates the arithmetic mean of each of the "data points" in the visual. In the screenshot, this is the mean of the 3 values = 14.6.
  2. The Total in the table is the arithmetic mean of each value in the 'Testing'[Total Duration] column, so each row of the 'Testing' table has equal weighting.

To produce the same result in both visuals, you could instead use a measure like this (I'm assuming Release is in the 'Testing' table):

Average_Total_Duration=
VAR TD =
    AVERAGEX ( 
        VALUES ( 'Testing'[Release] ),
        CALCULATE ( AVERAGE ( 'Testing'[Total Duration] ) )
    )
RETURN
    TD

 This calculates the average per Release, then averages those.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Hi Owen, thank you so much for your help and time. I really appreciate your explanation on what is going on between the 2 calculations -  in the below calculation first we calculate the CALCULATE ( AVERAGE ( 'Testing'[Total Duration] ) ) this gives me the same result which gives me the same result as table 17.9 
then for each unique value in the release we are calculating the average using the average x function

Average_Total_Duration=
VAR TD =
AVERAGEX (
VALUES ( 'Testing'[Release] ),
CALCULATE ( AVERAGE ( 'Testing'[Total Duration] ) )
)
RETURN
TD


thanks a lot

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.