Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |