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
jaydesai28
Frequent Visitor

DAX formula for calculating average for particular category is not working

I made one measure for calcualting average execution time per report but it does not work.

 

AverageExecutionTime = CALCULATE(AVERAGE(ReportFields[TotalTime]),ALLEXCEPT(ReportFields,ReportFields[ReportName]))

Capture2.PNG

I am using  Direct Query mode.

1 ACCEPTED SOLUTION

I'm not 100% sure what your looking for but if I create a calculated column using:

 

AverageExecutionTime = CALCULATE(AVERAGEA(Sheet1[TotalTime]),ALLEXCEPT(Sheet1, Sheet1[ReportName]))

 

I get:

ReportTest.PNG

 

 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

@jaydesai28

 

You look close. You might want to try swapping out the ALLEXCEPT for ALLSELECTED.

 

AverageExecutionTime = CALCULATE(AVERAGE(ReportFields[TotalTime]),ALLSELECTED(ReportFields[ReportName]))

 

Hope this helps,

Parker

Capture3.PNG

It does not wotk either.

Anonymous
Not applicable

Try this:

 

AverageExecutionTime = 
VAR CurrentReport = FIRSTNONBLANK(ReportFields[ReportName]),1)
RETURN
CALCULATE(
AVERAGE(ReportFields[TotalTime]),
FILTER(
ALL(ReportFields),
ReportFields[ReportName] = CurrentReport
)
)



 

I'm not 100% sure what your looking for but if I create a calculated column using:

 

AverageExecutionTime = CALCULATE(AVERAGEA(Sheet1[TotalTime]),ALLEXCEPT(Sheet1, Sheet1[ReportName]))

 

I get:

ReportTest.PNG

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.