Forum Discussion
rkgundabhat
2 years agoHelper I
Filter data
Hello , My table has these columns CaseNumber ,Department, CaseOpenedDate, CaseTerminatedDate, CaseCloseDate. I want to know cases which were open in a given month. My example query for the cases w...
- 2 years ago
rkgundabhat
Please try this measure:Open Cases = CALCULATE( COUNTROWS('CaseTable'), FILTER( 'CaseTable', 'CaseTable'[CaseOpenedDate] <= MAX('Dates'[Date]) && ( 'CaseTable'[CaseTerminatedDate] = BLANK() || 'CaseTable'[CaseTerminatedDate] >= MIN('Dates'[Date]) ) && ( 'CaseTable'[CaseCloseDate] = BLANK() || 'CaseTable'[CaseCloseDate] >= MIN('Dates'[Date]) ) ) )
Ashish_Mathur
2 years agoSuper User
Hi,
Share some data to work with (in a format that can be pasted in an MS Excel file) and show the expected result.
rkgundabhat
2 years agoHelper I
| CaseNumber | Department | CaseOpenedDate | CaseTerminatedDate | CaseCloseDate |
| 1231 | HR | 6/2/2021 | 6/2/2022 | 6/3/2022 |
| 1232 | Accounts | 9/15/2022 | 6/2/2023 | 10/2/2023 |
| 1233 | Facility | 2/23/2023 | 6/2/2023 | |
| 1234 | IT | 2/1/2019 | 10/2/2022 | 11/2/2022 |
The request is "Show all the cases active in a given month for a department" .
I figured that I need to use the above query to get my the result which would be cases 1232 and 1234.
In my report canvas I have filter for department so if I select IT then my count should be 1.
I am not able to understand what filter do I need to select a year/month in the canvas to get the count for a department and how to use the query.