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
shanebo3239
Helper I
Helper I

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 1
stretcharm
Memorable Member
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))

 

 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.