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
JimJim
Helper V
Helper V

Average

Hello,

 

I am trying (and failing) to work out the average execution time of a report. I have a fact table called ReportExecution in the following (simplified) format:

 

Date          ReportName          UserName          ReportCount          AvgerageTime

20/12/17   StockReport           Joe Lewis            6                            31

21/12/17   StockReport           Joe Lewis            5                            36

21/12/17   StockReport           Asim Shah          8                            49

22/12/17   StockReport           Asim Shah          2                            50

 

The table has one row for every user / day / report, ReportCount is the total times a user has run the report for that day.

 

I need to get the actual average and not just an average of an average.

 

If I was doing this in excel I would do something like...

 

1. Get total time for each row by multiplying average time by report count
2. Get the total time for the set by summing the row totals
3. Get the total report count by summing the report count for each row
4. Divide the total time by the total report count

 

 

Any help would be appreciated.

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

So, maybe create a new column in your fact table:

 

TotalTime = [ReportCount] * [AverageTime]

Then create a measure like:

 

MyAverage = DIVIDE(SUM([TotalTime]),SUM([ReportCount]))

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

So, maybe create a new column in your fact table:

 

TotalTime = [ReportCount] * [AverageTime]

Then create a measure like:

 

MyAverage = DIVIDE(SUM([TotalTime]),SUM([ReportCount]))

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Excellent, thank you.

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.