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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.