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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
sjacksonlincs
New Member

How to get average per person from two measures

Hi,

 

I am relatively new to Power BI but am struggling with something that seems should be fairly straight forward...

 

I have two imported tables, one for 'Calls' and the other for 'Cash'.

 

I want to calculate the average cash collection by user which should be the total cash divided by number of calls taken.

 

On my cash table i have the measure: 

SumOfCash = CALCULATE(SUM(Cash[SumOfAmount £]))
 
On my calls table I have the measure:
SumOfCalls = CALCULATE(SUM(Telephony[Accepted]))
 
Now i want to create a new measure that takes the cash measure and divides it by the calls measure.
 
I have tried this with: 
AvgCashPerCall = CALCULATE(SUM(Cash[SumOfAmount £])/SUM(Telephony[Accepted])) which gives be an overall average total (which is correct) but when i create a table and in the users, the average per user shows as a very low decimilised number.

 

sjacksonlincs_0-1620818863141.png

 

Can someone advise me what i'm doing wrong please?

 

Thanks

 

2 REPLIES 2
sjacksonlincs
New Member

@Anonymous thank you.

 

I have re-written to your above suggestion but still not able to arrive at the expected individual averages.

 

As pictured, the £24.81 average is correct but the minute i add a table and try to do it by user, the averages for each user are substantially lower. 

 

sjacksonlincs_0-1620822948469.png

 

Anonymous
Not applicable

Your measure should be written as:

 

[AvgCashPerCall] = divide( [SumOfCash], [SumOfCalls] )

 

since code duplication is a the worst thing that can happen in programming.

 

However, to tell you whether this calculation is correct for any slice of your data... well, that requires to know your data, the model and the business requirements. It's not possible to say if that's correct right now since what DAX calculates depends on the underlying tables and the relationships between them.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

Top Solution Authors