Tableau Count Records Between Date Ranges

I am trying to get a count of records between dates. My data has records from 01/01/2020 to 04/01/2020. I have set up two parameters, Start-date & End-date I only want to count the records that are between my start (01/01/2020) and end date (01/31/2020).

Sample Data
Sheet_ID  Supervisor_ID   Category_ID   Date
OB-111       1111            1          01/01/2020
OB-112       1111            4          03/01/2020
OB-113       1111            2          01/01/2020
OB-114       2222            2          01/01/2020
OB-115       2222            2          01/21/2020

I am trying to show the following

Supervisor_ID   Category_ID     Count
1111              1              1
1111              2              1
2222              2              2

Thank you in advance!

1 answer

  • answered 2020-07-30 06:00 Andy TAR Sols

    Create a calculated as follows:

    IF [Date]>=[StartDate] AND [Date]<=[EndDate] THEN 1 END
    

    Sum this field to get the count.