Forum Discussion

floppysock's avatar
floppysock
Frequent Visitor
3 years ago
Solved

Average Issues

Hi all - I'm struggling to figure out how to get the averages working correctly for a data set that already has averages in. 

 

The data set - e.g. row 1 is saying Agent 1 completed 3 tasks and they averaged 3 hours each to complete (i.e. 4 hours, 3 hours and 2 hours to complete each task averaging 3 hours): 

 

Team NameAgent IDVolume CompletedAVG Hours to Complete
Team 1Agent 133
Team 1Agent 257
Team 1Agent 385
Team 1Agent 447
Team 2Agent 533
Team 2Agent 652
Team 2Agent 762
Team 2Agent 883

 

I need to create a visualisation table which will show the following, I have it all apart from the final column: 

Team NameAgent VolumeVolume CompletedAVG Hours to Complete
Team 1420?
Team 2422?

 

I know that the avg hours to complete per team will be something along the lines of: 

SUM(Volume Completed * AVG Hours to Complete) / Total Volume Completed by team 

 

But I don't know how to get this to work in PowerBI. 

 

Any help would be really appreciated! 

  • hi floppysock 

    try to plot a table visual wit the Team Name column and a measure like:

    Avg = 
    DIVIDE(
        SUMX(
            TableName,
            TableName[Volume Completed]*TableName[AVG Hours to Complete]
        ),
        SUM(TableName[Volume Completed])
    )

     

    it worked like:

     

2 Replies

  • hi floppysock 

    try to plot a table visual wit the Team Name column and a measure like:

    Avg = 
    DIVIDE(
        SUMX(
            TableName,
            TableName[Volume Completed]*TableName[AVG Hours to Complete]
        ),
        SUM(TableName[Volume Completed])
    )

     

    it worked like:

     

    • floppysock's avatar
      floppysock
      Frequent Visitor

      This is exactly what I needed - thanks so much. 

      I think I need to go read up and explore the SUMX etc functions as the key lies there.