I am trying to create a calculation in Tableau as I have in excel. I could do first half of it, but not sure how to give the condition for months. Below is how my raw data looks like.
ID Month CASE_STATUS CASE_TYPE
1011 2/1/2016 Closed Group1
1012 2/1/2016 Closed Group2
1013 3/1/2016 Open Group1
1014 3/1/2016 Closed Group3
1015 3/1/2016 Closed Group3
1016 4/1/2016 Unkwn Group1
1017 4/1/2016 Closed Group7
1018 4/1/2016 Closed Group5
1019 4/1/2016 Closed Group4
1020 2/1/2016 Open Group1
1021 3/1/2016 Closed Group1
1022 4/1/2016 Closed Group2
1023 4/1/2016 Uknwn Group1
1024 2/1/2016 Closed Group4
1025 2/1/2016 Closed Group5
1026 2/1/2016 Closed Group2
1027 3/1/2016 Closed Group3
I want to create a reference line that adds all ID's (sum of count of ID's) divide by 13 for Feb, Mar and April. This reference line will start from May and be constant for the year
field1:
IIF(
(month([Fiscal Month]) >1) and (month([Fiscal Month]) <5 and (year([Fiscal Month]) = 2016)) , 1,0)
field2:
if sum([field1]) > 1
then round(div((count[ID]),13))
else 0
end
But this does not give me the reference line I am looking for.
I have an example image, but not sure how could I insert that here.