cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
aktripathi2506
Helper IV
Helper IV

Average error in total

HI,

 

Please see below the example. In a table/matrix the total of average value is different from the real average.

 

This is what it look likes in power BI:

 

 avg problem.png

 

 

 

And when we calculate the average of same number in excel then it is different…it is off by some small number but I need it exactly same or the reason behind it.

 

 

weekAverage of ABAverage of BC
169.00%67.67%
277.60%63.28%
374.60%58.85%
489.40%67.36%
588.90%72.01%
695.80%72.96%
797.60%93.03%
896.90%88.91%
999.50%99.08%
1077.20%66.94%
1194.30%89.35%
1280.00%88.72%
1382.90%89.80%
average86.44%78.30%

 

As we can see in both the tables, even after having the same number the average of average is different.

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

You need to do an Average of the averages because the total that you see is Allvalues/All Rows.

 

TO solve this use:

 

AverageAB = AVERAGEX(SUMMARIZE('Table';'Table'[week];"TheAverageAB";Sum('Table'[A])/Sum('Table'[B]));[TheAverageAB])

 

 

You can change with your columns name.




Lima - Peru

View solution in original post

5 REPLIES 5
Vvelarde
Community Champion
Community Champion

You need to do an Average of the averages because the total that you see is Allvalues/All Rows.

 

TO solve this use:

 

AverageAB = AVERAGEX(SUMMARIZE('Table';'Table'[week];"TheAverageAB";Sum('Table'[A])/Sum('Table'[B]));[TheAverageAB])

 

 

You can change with your columns name.




Lima - Peru

Hi @Vvelarde,

 

Thank you.

In the formula for the measure, I did not understand this part:

Sum('Table'[A])/Sum('Table'[B]))

 

What is 'Table'[A]and 'Table'[B] representing here with respect to the table I have used as an example.

'AB' is the name of one column, there is no column named A or B.

 

Thanks.

Change to this:

 

AverageAB = AVERAGEX(SUMMARIZE('Table';'Table'[week];"TheAverageAB";Average('Table'[AB]));[TheAverageAB])




Lima - Peru

@aktripathi2506

 

Ok, i think that is a average of two columns (A & B).

 

Change to this:

 

AverageAB = AVERAGEX(SUMMARIZE('Table';'Table'[week];"TheAverageAB";Average('Table'[AB]));[TheAverageAB])




Lima - Peru
Vvelarde
Community Champion
Community Champion

You want an average of all averages. In excel you are using for the total  the formula verage(Alltheaverages Range) is correct?

 

The average that you are seeing in the visual is: AllmyValues/NumberofRows so the result is different.

 

You can use this measure to solve this:

 

AverageofAB= AVERAGEX(SUMMARIZE('Table';'Table'[week];"AverageAB";Sum('Table'[ValuesA])/AVERAGE('Table'[B]));[AverageAB])

 

 




Lima - Peru

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors