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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
dnewton
Helper II
Helper II

Creating an average from a measure?

Hi All,

 

I have a measure "CountCalls" - this calculated based on 'COUNTROWS' and tells me how many calls have been recieved.

 

I'm trying to create an average of 'CountCalls' but it's not possible to create 'AVERAGE(CountCalls)' as "CountCalls" is a measure not a column.

 

Any idea how I can acheive this? So I need to COUNTROWS then create an average of the number of rows counted somehow?

 

 

6 REPLIES 6
DAX0110
Resolver V
Resolver V

Hi @dnewton, you might want to try AVERAGEX - the iterator version of AVERAGE

I've looked at a few AVERAGEX examples but can't figure out how to use this in practice.

 

The example of AVERAGEX I've found is...

 

AVERAGEX(<table>,<expression>

So I'm guessing this translates to...

AVERAGEX(<mycallstable>,<expression>)

But I don't understand what <expression> I would use.

try this:

 

averageX Count Calls monthly =

AVERAGEX (

 ALLSELECTED ( 'Date'[Month]) , [CountCalls] )

 

averageX Count Calls weekly =

AVERAGEX (

 ALLSELECTED ( 'Date'[Week]) , [CountCalls] )

Hi @dnewton, in this case <expression> would be your measure CountCalls

 

I found a good tutorial on this function on this page:

https://powerpivotpro.com/2010/09/averagex-the-5-point-palm-exploding-fxn-technique-revisited/

 

Also, like @jthomson mentioned, you have to think about what you want to average over - do you want daily average? Or monthly?  That would determine what the <table> argument should be.

jthomson
Solution Sage
Solution Sage

What are you wanting to create an average in relation to? Your question makes no sense without additional context. If it was something like, say, average calls per day, you can just look to distinctcount the different number of dates in your table and then divide your measure by the result

Apologies, yes it would be the average from a period of time which maybe daily, weekly, monthly etc...

 

The existing measure uses COUNTROWS to count each row in my table and then returns the total number of calls, hence 'CountCalls'. I need to try and work out the average from 'CountCalls' but this is not as straightforward as AVERAGE(CountCalls) since 'CountCalls' is just a measure not a column.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors