Forum Discussion
SHILL
4 years agoFrequent Visitor
Count above average
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 |
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
3 Replies
- HeadlineNew Member
You can use
DATEDIFF(FIRSTDATE(columd(date)]),TODAY(),MONTH) after that If the result is greater than your limited number, use a new if formula = if ( result>="Your limited number","closed case","Open case" ) - daXtremeSolution Sage
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- SHILLFrequent Visitor
Thanks,Thats worked!