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_TYPE1011 2/1/2016 Closed Group11012 2/1/2016 Closed Group21013 3/1/2016 Open Group11014 3/1/2016 Closed Group31015 3/1/2016 Closed Group31016 4/1/2016 Unkwn Group11017 4/1/2016 Closed Group71018 4/1/2016 Closed Group51019 4/1/2016 Closed Group41020 2/1/2016 Open Group11021 3/1/2016 Closed Group11022 4/1/2016 Closed Group21023 4/1/2016 Uknwn Group11024 2/1/2016 Closed Group41025 2/1/2016 Closed Group51026 2/1/2016 Closed Group21027 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.