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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.