Thank you! That helped.
Do you mind explaining to me why my formula didn't work and yours did? I feel like logically my formula was correct.
3 of 3 people found this helpful
Lets analyse this two clauses:
Yours: IF attr([Job Status]) = "Filled" THEN AVG([Days since Open Date]) END
Mine: AVG(IF [Job Status] = "Filled" THEN ([Days since Open Date]) END)
In yours, overall, it is a logical function. Importantly, it only tells how to handle "filled", it did not tell how to do with the measure if job status is not "filled", So tableau does not know how to do this if job status includes both "filled" and "closed".
In mine, overall, it is not logical function. It is an aggregate calculation (logical function is embedded in it). It simply gives the aggregate data when IF logical function is met.
Please remember. If you use logical function, you need to drag the dimension to the view and satisfy the condition (here, filter out "Closed"). Otherwise, the measure does not show.
So, in your calculation, if you drag job status to the row and filter it only for "filled", you also get 5.2, correct answer.
Hope it helps.