Forum Discussion

shanebo3239's avatar
shanebo3239
Helper I
8 years ago

Two line chart - One sliced, one not

So, Im trying to create a line chart that shows how an employee's performance compares to the rest of the employees' performances over time.  The first line would be the employee's sales performance, the second line would be the average sales performance of the rest of the employees in the company.  For purposes of this, let's just assume I'm looking at this data month over month on the line chart.  

 

To do this, I have one measure called AverageSales which is just =AVG(NumberOfSales).  The second measure I have is AverageSalesAllEmployees which is =CALCULATE(AVG(NumberOfSales),ALL(EmployeeId))

 

Yet, for whatever reason, when I chart both of these over time on a line chart, changing the employee slicer in the report changes BOTH the employees data AND the AverageSalesAllEmployees data.  This is baffling to me.

 

Can anyone help?

1 Reply

  • stretcharm's avatar
    stretcharm
    Memorable Member

    I had a play with this and your calc works ok for me if I have a single query.

    However if I put employee details into a different table and join that to the sales then slice the employer from then I can same problem.

     

    To resolve it I changed the ALL to related to the whole sales table/query not just the employeeid.

     

    AverageSalesAllEmployees = CALCULATE(AVG(SalesData[NumberOfSales]),ALL(SalesData))