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
lcfaria
Helper II
Helper II

Divergent values in the average calculation

Hi everyone,

 

I'm trying to calculate the average by manager, but this has given me different results depending on the filter applied.

 

When I have the unit and manager in the table, the result presented is correct, the average of all managers for unit A is 2.82%.

lcfaria_0-1665246180018.png

However, when I remove the managers from the table and keep only the unit, the value presented is different, 2.07% and this value is incorrect.

lcfaria_1-1665246199959.png

I've racked my brains trying to find the problem, but I couldn't, so I turn to the community to see if anyone can help me.

 

I am attaching a sample file with the problem presented: https://1drv.ms/u/s!At5JlMR_naI1gf41c2mHw5cyNda9bg?e=tq81Rz

 

Thank you!

1 ACCEPTED SOLUTION
aj1973
Community Champion
Community Champion

Hi @lcfaria 

The 2.07% is the correct one. it represents the SUM of [Bonus] = 62 divided by the DISTINCTCOUNT of the number of managers that = 30 of the Unit A.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

2 REPLIES 2
aj1973
Community Champion
Community Champion

Hi @lcfaria 

The 2.07% is the correct one. it represents the SUM of [Bonus] = 62 divided by the DISTINCTCOUNT of the number of managers that = 30 of the Unit A.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Hi @aj1973

I already realized where the problem was, although I have 30 distinct managers, it should only consider those that have a target > 0, in the case of the example, 22 managers.

62 / 22 = 2.82%

 

Although I had a filter applied to the visual only for target > 0:

lcfaria_0-1665358629858.png

When I removed the managers from the table and kept only the unit, the measure stopped considering the 22 managers and started to consider all 30 (I still don't understand why this failed to consider the filter applied in the image above).

I made a simple change in the measure DAX and it solved the problem:

lcfaria_1-1665358807489.png

 

Your answer helped me find the problem, thank you very much!

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!

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.