In a table chart where CY, PY, and YOY% are used as measures, how can we handle YOY% calculation such that:
- When CY > 0 and PY = 0, YOY% displays ‘N/A’ (in both label and tooltip),
- When CY = 0 and PY = 0, YOY% displays ‘0%’,
- And for all other cases, YOY% is calculated and displayed normally, without affecting the overall YOY% logic across the chart
- As shown in image I have to display YOY%=N/A without affecting other YOY% values
#Tableau Public
2 answers
@VARSHA GHOGARE, create a separate display calculation. Keep your real YOY% as a numeric field, but return NULL when CY > 0 and PY = 0, because YOY is mathematically undefined in that case. Then create a second string field for label/tooltip that returns "N/A", "0%", or the formatted YOY value. This avoids breaking the actual YOY% logic while still showing N/A to users.