Forum Discussion

heygowtam's avatar
heygowtam
Icon for Helper II rankHelper II
4 years ago
Solved

Average Calculation Problem

I have two columns for employees and their leave details

1) If I Calculate the planned Average,  Because of the Same name it calculates as 1 instead of 2 

for example - Employee [Stace] has two plan leaves, when I calculate the average it gives me as  

TOTAL VALUE / COUNT(planned ) 

should take 6 instead its taking 4 because of same name 

5 Replies

  • MahyarTF's avatar
    MahyarTF
    Icon for Memorable Member rankMemorable Member

    Hi,

    if you want to calculate the average of the planned value for each employee (exclude the null value) use the below code in your measure :

    DIVIDE( sum(Sheet234[planned]), COUNT(Sheet234[planned]))
    If you want to include the null value per each employee : 
    DIVIDE( sum(Sheet234[planned]), CALCULATE(COUNTROWS(sheet234), Sheet234[Employe] = SELECTEDVALUE(Sheet234[Employe])), 0)
    This is the sample data :

    Appreciate your kudos and please mark it as solution if it helps

    • heygowtam's avatar
      heygowtam
      Icon for Helper II rankHelper II

      Hi, Thanks for the reply The value seems the Same even after trying both options.

  • Hi,

    Share some data to work with and show the expected result.