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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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