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

Calculate average of a measure or create new column

Hello,

 

I have some times that I am trying to get the average of:

 

Overview:

There are individuals that have the same activity and I am trying to find the average time (occurred) of each activity. Below is an example of an activity that I want to calculate the average first onsite for  :

Capture.PNG

 

I created the measure to select the min of this activity:

CALCULATE(MIN('Tech Activity'[OCCURRED]),'Tech Activity'[CORE_DESCRIPTION]="AsnAssignmentOnSite_evt")

 

After creating this measure, I want to take the average but im having difficulty because I can only take the average of a column.

 

Can someone give me advice on how to calculate the average?

 

Thanks!

 

 

9 REPLIES 9
Anonymous
Not applicable

Hi @sccoleman1189 

 

Create 2 measures as below,

 

1. Min Occurred =MIN('Tech Activity'[OCCURRED])

2. Average Occurred = AVERAGEX(FILTER('Tech Activity','Tech Activity'[CORE_DESCRIPTION]="AsnAssignmentOnSite_evt"), Min Occurred)

 

Please let me know if this helps.

v-chuncz-msft
Community Support
Community Support

@sccoleman1189 

 

You may try using AVERAGEX.

Community Support Team _ Sam Zha
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 @sccoleman1189 ,

 

I am hoping that you have already tried basic dax calculations.

I think there are many ways to do it but I prefer two ways

1. If data is coming from db then you can make necessary calculations in DB and make separate views as per requirement then take average in power bi.

2. Using Dax make a summary table with your data then take the average of that column.

 

 I am hoping this will work, If not you can revert with the sample pbix file Smiley Happy

 

Best Regards,

Ravi

I tried to select the min and max in the database but it returned the same value for each column. Not sure how to make a summary table. I new to Power BI

Anonymous
Not applicable

Did you try Dax which @santiagomur  mentioned above? 

Yes. Because I need to capture the min and max of each activity then average each, the DAX that was provided doesnt work.

Anonymous
Not applicable

Give me sample data or pbix i will work on that. 

avg activity=
var maxcal=CALCULATE(MAX('Tech Activity'[OCCURRED]),FILTER('Tech Activity',[CORE_DESCRIPTION]="AsnAssignmentOnSite_evt"))

var mincal=CALCULATE(MIN('Tech Activity'[OCCURRED]),FILTER('Tech Activity',[CORE_DESCRIPTION]="AsnAssignmentOnSite_evt"))

return
(maxcal+mincal)/2
santiagomur
Resolver II
Resolver II

CALCULATE(AVERAGE('Tech Activity'[OCCURRED]),FILTER('Tech Activity',[CORE_DESCRIPTION]="AsnAssignmentOnSite_evt"))

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.