Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Calculate solve complaints days without Weekends

amitchandak Jimmy801 this might be a common issue but I cannot find an exact solution, Please help me if you can, Thanks in advance.  I am trying to calculate the number of days we are taking to sol...
  • littlemojopuppy's avatar
    littlemojopuppy
    5 years ago

    Anonymous if you want to try using something in a card try this.

    VAR	IncidentSummary =
    	SUMMARIZE(
    		ALLSELECTED(Incidents),
    		Incidents[IncidentID],
    		Incidents[Createdon Date],
    		Incidents[cmx_solveddate],
    		"DaysToResolve",
    		COUNTROWS(
    			FILTER(
    				ALL(DateTable),
    				DateTable[Date] >= Incidents[Createdon Date] &&
    				DateTable[Date] <= Incidents[cmx_solveddate] &&
    				NOT(DateTable[Weekday] IN {6, 7}) &&
    				DateTable[IsWorkingDay] = TRUE()
    			)
    		)
    	)
    RETURN
    
    AVERAGEX(
    	IncidentSummary,
    	[DaysToResolve]
    )

    I'm typing this in Notepad so no warranty it's correct.  And I expect you to make a reasonable effort to debug for extra parentheses and that it was copied correctly.  If it's not good after that, I need you to provide actual data I can work with.