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

How to calculate average of simple column

Hi Team,

 

I've got a column that contains all the phone calls taken by agents for the month. I would like to create a column caled 'Average' which calculates the average percentage of calls taken by each agents.

Ideally the formula would be total queue call taken by agent / total number of queue calls taken by all agents

However, when I use the Average DAX function in power BI, it return the same value (see image below)

Please advise what I'm doing wrong.

 

My column is not calculating the Average properlyMy column is not calculating the Average properly

 

Assuming the total number of calls is 2880, the result I want is:

hitman2022_0-1656069195656.png

 

1 ACCEPTED SOLUTION

Hi @Anonymous 

Please find attached the dropbox link with the PBIX file.

The SubAvg column is the final result that you are looking for.

https://www.dropbox.com/s/a52hlwjy7nhqu8w/SD%20Monthly%20Reporting.pbix?dl=0

View solution in original post

30 REPLIES 30
Anonymous
Not applicable

Thank you so much @Seanan That has resolved the issue.

 

Thanks to everyone who tried to help in this post as well. I never knew I'd be receving this great help. 🏆

Anonymous
Not applicable

Sorry guys, would you know why the SubAvg changes all to 100% when I try to add another column into this visual.

hitman2022_0-1656414428434.png

 

@Anonymous 

Which column from which table?

Anonymous
Not applicable

Any of the columns highlighted in red basically changes the SubAvg into 100%. 

hitman2022_0-1656416001368.png

 

@Anonymous 

Once you add any column to a table or matrix visual it becomes part of the filter context. In this case it is not wise to keep changing the total measure formula to adapt with every column you add. Therefore it is recommended to use only one column for slicing (Agent) and add other columns only as measures. For example SUM ( [Count] ) or SELECTEVALUE ( [Net Login] )

Anonymous
Not applicable

@Anonymous 
Sorry I just saw your reply and I noticed that you are slicing by a column from the fact table.

Here is the file https://we.tl/t-Y0Ffz8gEKD

Please try allways to slice by columns from dim tables  oly as fact tables cannot filter dim tables and you'll be in trouble. Here is a screenshot of the table visual with all required columns added. Only a small fix by replacing the fact [Agent] column with dim [Agent Name] column. The same is reflected on the formiula of the measure [Total] (As per my pervious reply to the original query of this post).

1.png

@Anonymous This is working for me try this

Average =
var a = CALCULATE(SUM('Table (2)'[call]),all('Table (2)'))
return DIVIDE(
SUM('Table (2)'[call]),
a)
Surya9_0-1656071830916.png

 

Surya9
Helper V
Helper V

@Anonymous 
Create a measure that will give you the expected output

 

@Anonymous you are looking for the % of call taken by the user 
i think this will help you try the below measure

Average =
var a = CALCULATE(SUM('Table (2)'[call]),REMOVEFILTERS('Table (2)'[name]))
return DIVIDE(
SUM('Table (2)'[call]),
a)
Surya9_0-1656070341132.png

you can also use All Insted of Removefilter

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.