Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

What's the best way to illustrate weighted contributors to an average?

Say I'm reporting on average repair minutes for mechanical technicians. Every week I average all cases across all technicians. Here's a dataset:

 

TechnicianWeek EndingRepair Minutes
Technician 110-Mar129
Technician 210-Mar157
Technician 210-Mar165
Technician 210-Mar360
Technician 310-Mar316
Technician 310-Mar186
Technician 310-Mar333
Technician 310-Mar387
Technician 117-Mar67
Technician 117-Mar344
Technician 217-Mar137
Technician 217-Mar296
Technician 317-Mar392
Technician 317-Mar170

 

So for Week Ending 10-Mar, I average 254.1 minutes. For Week Ending 17-Mar, I average 234.3 minutes.

 

I want to represent for their managers the way each technician contributed to the week over week change in average. It would be great to do that in a waterfall-style chart, but since we're dealing in averages instead of totals, it doesn't work the same way. 

 

Is there a good way to go about this in Power BI?

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

So this was going great right up until the end, I kind of had to guess at what you were going for, but perhaps try creating a table like this:

 

Table = VAR myTable = SUMMARIZE(RepairMinutes,RepairMinutes[Technician],RepairMinutes[Week Ending],"Avg",AVERAGE(RepairMinutes[Repair Minutes]))
RETURN myTable

RepairMinutes is the name I gave to the table of data that you provided (that's the way to do it!).

 

Then you can create a column like this:

 

Column = 
VAR lastweek = MINX(FILTER('Table',
                       'Table'[Technician]=EARLIER('Table'[Technician])
               ),'Table'[Week Ending])
VAR lastweekAvg = MINX(FILTER('Table','Table'[Technician]=EARLIER('Table'[Technician]) && 'Table'[Week Ending]=lastweek),'Table'[Avg])
VAR PercentChange = (lastweekAvg - 'Table'[Avg])/lastweekAvg
RETURN PercentChange

 

 You should end up with a table like this:

 

Technician         Avg                           Week Ending                     Column

Technician 1 129 3/10/2018 12:00:00 AM 0.00
Technician 2 227.333333333333 3/10/2018 12:00:00 AM 0.00
Technician 3 305.5 3/10/2018 12:00:00 AM 0.00
Technician 1 205.5 3/17/2018 12:00:00 AM -0.59
Technician 2 216.5 3/17/2018 12:00:00 AM 0.05
Technician 3 281 3/17/2018 12:00:00 AM 0.08

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Super User
Super User

So this was going great right up until the end, I kind of had to guess at what you were going for, but perhaps try creating a table like this:

 

Table = VAR myTable = SUMMARIZE(RepairMinutes,RepairMinutes[Technician],RepairMinutes[Week Ending],"Avg",AVERAGE(RepairMinutes[Repair Minutes]))
RETURN myTable

RepairMinutes is the name I gave to the table of data that you provided (that's the way to do it!).

 

Then you can create a column like this:

 

Column = 
VAR lastweek = MINX(FILTER('Table',
                       'Table'[Technician]=EARLIER('Table'[Technician])
               ),'Table'[Week Ending])
VAR lastweekAvg = MINX(FILTER('Table','Table'[Technician]=EARLIER('Table'[Technician]) && 'Table'[Week Ending]=lastweek),'Table'[Avg])
VAR PercentChange = (lastweekAvg - 'Table'[Avg])/lastweekAvg
RETURN PercentChange

 

 You should end up with a table like this:

 

Technician         Avg                           Week Ending                     Column

Technician 1 129 3/10/2018 12:00:00 AM 0.00
Technician 2 227.333333333333 3/10/2018 12:00:00 AM 0.00
Technician 3 305.5 3/10/2018 12:00:00 AM 0.00
Technician 1 205.5 3/17/2018 12:00:00 AM -0.59
Technician 2 216.5 3/17/2018 12:00:00 AM 0.05
Technician 3 281 3/17/2018 12:00:00 AM 0.08

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.