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

Average Calls per Day DAX help

Hi,

 

I am looking for a DAX code to calculate the average amount of phone calls per day.

My data looks like that:

Table 1:

Call IDDateUser IDBU IDWeighted Call
101/01/20210110.75
201/01/20210220.3
301/01/20210111
401/02/20210110.15

5

01/02/20210220.3

6

01/03/20210331

7

01/03/20210330.9

8

01/03/20210220.8

 

So far I made a measure for the sum of Weighted Calls:

 

Weighted Calls =
SUM(
    'Table_1'[Weighted Call]
)

 

 

Want I want do display in Power BI via matrix visual is the average (weighted) calls per day for User or BU.

I made a measure for the average Calls:

 

Average Weighted Calls per Day =
AVERAGEX(
    VALUES(
       'Table_1'[Date]
    ),
    [Weighted Calls]
)

 

 

If a go ahead and make a matrix visual to show the BU ID on a row level and the [Average Weighted Calls per Day] as Values the result per row seems to be right but the Total row on the bottom is showing the sum of the different averages per row (BU ID) and not the total average across all data; for example:

 

BU IDAverage Weighted Calls per Day
14.3
25.1
35.8
Total15.2

 

What do I need to do with my measure to display the correct Total in the Total Row?

 

Thanks

1 ACCEPTED SOLUTION
daxer-almighty
Solution Sage
Solution Sage

8 REPLIES 8
daxer-almighty
Solution Sage
Solution Sage

daxeralmighty_0-1626266925156.png

 

Thank you very much.
That was exactly what I was looking for.
Obviously I tried to be as precise as possible to get an efficient discussion going but unfortunately could not manage to express my exact needs to do so.

Anonymous
Not applicable

If you had said: "I want an average over BU's of averages over days.", that would have been straight to the point. It would have been as clear as the Sun. Nothing more needed but knowing what the model looks like.

In retrospect it makes a lot of sense to communicate it like that. Don't worry I'll try my very best to be more precise next time. I wasn't trying to be imprecise on purpose, obviously.

 

daxer-almighty
Solution Sage
Solution Sage

daxeralmighty_1-1626264900930.png

 

 

I assume the problem is a conversion from my German units to the English client.
(In German we use the comma as a dot just the exact opposite way as in English writing).

 

So assuming the values in the table on your left are right I am looking at the value "44.37" as the "Total Daily Avg".

The result I am looking for is the Total Daily Avg across all BU IDs which actually is something like the "average of the averages" instead of the "sum of the averages"

Anonymous
Not applicable

daxer_0-1626253704831.png

That's what I get using your data...

Thanks for your reply!
If I use my sample data and your DAX code I also get correct results.

However if I use my real world data I do not get correct results.

 

I included my sample data in this Google Drive link:

Google Drive Sample Data 

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.

Top Solution Authors