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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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