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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
jaydesai28
Frequent Visitor

ALLEXCEPT function does not work with filter

I want to calculate the average report execution time per report. I created measure for average execution time.

 

AverageExecutionTime = CALCULATE(AVERAGE('Long Running Report'[TotalTime]),ALLEXCEPT('Long Running Report','Long Running Report'[ReportName]))

Data has one column called ReportPath which I am using as filter. when I don't filter on ReportPath measure shows correct average value per report.

 

 Capture.PNG

 

When I filter on ReportPath it shows wrong values.

 

Capture1.PNG

I know this is happening because of ALLEXCEPT(ReportName) but is there any way to include filter as well. There could be more than one filter on dashboard in any case it should display correct average. 

I am using DirectQueryMode cannot use FILTER.

1 ACCEPTED SOLUTION

Hi @jaydesai28,

 

Based on your data here, you can just remove the context of "TotalTime". 

AverageExecutionTime =
CALCULATE (
    AVERAGE ( 'Long Running Report'[TotalTime] ),
    ALL ( 'Long Running Report'[TotalTime] )
)

Or you can add the context of ReportPath to your formula.

AverageExecutionTime 2 =
CALCULATE (
    AVERAGE ( 'Long Running Report'[TotalTime] ),
    ALLEXCEPT (
        'Long Running Report',
        'Long Running Report'[ReportName],
        'Long Running Report'[ReportPath]
    )
)

ALLEXCEPT_function_does_not_work_with_filter

 

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @jaydesai28,

 

Could you please mark the proper answer as a solution?

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @jaydesai28,

 

Try out the function ALLSELECTED like below.

AverageExecutionTime =
CALCULATE (
    AVERAGE ( 'Long Running Report'[TotalTime] ),
    ALLSELECTED ( 'Long Running Report'[ReportName] )
)

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

It does not show correct average time. It's a replication of TotalTime.

Hi @jaydesai28,

 

Based on your data here, you can just remove the context of "TotalTime". 

AverageExecutionTime =
CALCULATE (
    AVERAGE ( 'Long Running Report'[TotalTime] ),
    ALL ( 'Long Running Report'[TotalTime] )
)

Or you can add the context of ReportPath to your formula.

AverageExecutionTime 2 =
CALCULATE (
    AVERAGE ( 'Long Running Report'[TotalTime] ),
    ALLEXCEPT (
        'Long Running Report',
        'Long Running Report'[ReportName],
        'Long Running Report'[ReportPath]
    )
)

ALLEXCEPT_function_does_not_work_with_filter

 

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.