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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Calculate average on data that are summarized

I have a table with case event data

Mini_1_0-1637858183677.png


How do I calculate the average where the durations are first summarised per case, and then divided by total number of cases. When I try now I'm only getting an average per row. 

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

Please have a try.

Create a measure.

Measure = var case_1 = SUMX(ALL('Table'),'Table'[Duration])
var number = CALCULATE(DISTINCTCOUNT('Table'[CaseNumber]),ALL('Table'))
var result = DIVIDE(case_1,number)
return result

11.PNG

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @Anonymous ,

Please provide some sample data and desired output. How many cases are the above data for?

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

This is sample data from two cases:

Mini_1_0-1638171868806.png

 

I want my average to be:
(546+339+2134+22+5) + (16) / 2 = 3046 + 16 / 2 = 1531
In other words:
total duration of case 1 + total duration case 2 / number of cases. 

This should just be a messure so that I can display the average case duration in for example a card

 

amitchandak
Super User
Super User

@Anonymous , Try measures like

 


Averagex(values(Table[Casenumber]), calculate(sum(Table[Duration In Min])) )

 

or

Averagex(summarize(Table, Table[Casenumber],"_1", calculate(sum(Table[Duration In Min])) ),[_1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.