Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have the below table in place and need to count how many open cases are above the average time usually taken to close.
I have a measure that is giving me the Average days taken to close (By averaging the difference between recieved/last worked column where the status is also closed) which is working fine.
Now I am trying to get a measure in place to count any cases that are over the average time taken to close but everything I try seems to count all cases regardless of if they are above or below average.
With the below, The outcome should be that the average days to close a case is 17.5 and so I have 1 case over that average.
| case Name | Recieved Date | Last Worked On | Status | Difference betwen recieved and last worked | current Age (Days) |
| Test 1 | 01/08/2022 | 02/08 | Open | 1 | 4 |
| Test 2 | 10/07/2022 | 20/07/2022 | Closed | 10 | |
| Test 3 | 5/07/2022 | 30/07/2022 | Closed | 25 | |
| Test 4 | 27/06/2022 | 01/08 | Open | 35 | 38 |
Solved! Go to Solution.
DEFINE
MEASURE 'Cases'[Avg Days to Close] =
CALCULATE(
AVERAGE( 'Cases'[Diff Received Worked On] ),
'Cases'[Status] = "closed",
REMOVEFILTERS( )
)
MEASURE 'Cases'[# Open Cases Above Avg] =
var AvgDaysToClose = [Avg Days to Close]
var CountOfCasesOfInterest =
if( NOT ISBLANK( AvgDaysToClose ),
COUNTROWS(
FILTER(
'Cases',
'Cases'[Diff Received Worked On] > AvgDaysToClose
&& 'Cases'[Status] = "open"
)
)
)
return
CountOfCasesOfInterest
DEFINE
MEASURE 'Cases'[Avg Days to Close] =
CALCULATE(
AVERAGE( 'Cases'[Diff Received Worked On] ),
'Cases'[Status] = "closed",
REMOVEFILTERS( )
)
MEASURE 'Cases'[# Open Cases Above Avg] =
var AvgDaysToClose = [Avg Days to Close]
var CountOfCasesOfInterest =
if( NOT ISBLANK( AvgDaysToClose ),
COUNTROWS(
FILTER(
'Cases',
'Cases'[Diff Received Worked On] > AvgDaysToClose
&& 'Cases'[Status] = "open"
)
)
)
return
CountOfCasesOfInterest
Thanks,Thats worked!
You can use
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 11 | |
| 9 | |
| 9 | |
| 8 |