I would like my result to be a list and each row be a person, with a column reporting how long each person was issued a specific item. To identify if a person has been issued a particular item, I created a flag using if then statements, which I plan on using in a filter. I then created a calculated a field that used datediff between the min issued date and max issued date, assuming that using the flag it would give me the min issued date for that specific item and the max issued date for that specific item. Unfortunately when I put the calculated field in the row shelf, it gives me the same number of months for every individual and row (407). I'm still learning how tableau works and confused why I'm not getting my expected result: an amount of months each individual has been issued a specific food item.
Here is my code for datefiff:
datediff ('month', min([Food Package Issued Start Date]),MAX([Food Package Issued End Date] ))
Your calculation is taking the Min and Max of all available dates, so it will be the same for every line. You will need to limit the dates available to the Min and Max functions for it to work as you hope. This can be done with a Level of detail calculation. This calculation will return the difference for each participant
{FIXED [Participant Name]:
datediff ('month', min([Food Package Issued Start Date]),MAX([Food Package Issued End Date] ))
}
If there are multiple items, you would need to add the item field to the FIXED list.