Forum Discussion
PBIUWO
Helper III
6 years agoCarrying Over Open Case Amount from Previous Month
Hi, I have a data source with cases with Open and Closed status with schedule dates, and the date that it closed. I am trying to figure out the % of cases closed in the same month as the sched...
v-lid-msft
Community Support
6 years agoHi PBIUWO ,
We can create a calculated table as column and then use several measure to meet your requirement:
Calculated table:
Calendar = ADDCOLUMNS(CALENDARAUTO(),"Month-Year",FORMAT([Date],"MMM YY"),"Sort",YEAR([Date]) * 100 + MONTH([Date]),"Year", YEAR([Date]))
Measures:
Previous Scheduled Cases that are still open =
VAR minDate =
MIN ( 'Calendar'[Date] )
RETURN
CALCULATE (
DISTINCTCOUNT ( 'Table'[Case #] ),
'Table'[Schedued Date] < minDate,
'Table'[Closed Date] >= minDate || ISBLANK('Table'[Closed Date])
)
Scheduled Cases =
CALCULATE(DISTINCTCOUNT('Table'[Case #]),'Table'[Schedued Date] in DISTINCT('Calendar'[Date]))
Total Cases = [Previous Scheduled Cases that are still open] + [Scheduled Cases]
Closed Cases = CALCULATE(DISTINCTCOUNT('Table'[Case #]),'Table'[Closed Date] in DISTINCT('Calendar'[Date]))
Closure Rate (%) =
DIVIDE([Closed Cases],[Total Cases],0)
// or using following without other measure
// VAR minDate =
// MIN ( 'Calendar'[Date] )
// RETURN
// DIVIDE (
// CALCULATE (
// DISTINCTCOUNT ( 'Table'[Case #] ),
// 'Table'[Closed Date] IN DISTINCT ( 'Calendar'[Date] )
// ),
// CALCULATE (
// DISTINCTCOUNT ( 'Table'[Case #] ),
// 'Table'[Schedued Date] < minDate
// , 'Table'[Closed Date] >= minDate || ISBLANK('Table'[Closed Date])
// )+ CALCULATE (
// DISTINCTCOUNT ( 'Table'[Case #] ),
// 'Table'[Schedued Date] IN DISTINCT ( 'Calendar'[Date] )
// ) ,
// 0
// )
By the way, PBIX file as attached.
Best regards,
- PBIUWO6 years ago
Helper III