Cathy Liu
05/27/2026, 2:48 AMkapa.ai
05/27/2026, 2:49 AMFOR Previous works in this context. Here's what's happening and how to fix it:
Why You're Getting 0% Your YoY metric is:
SELECT {metric/turnover_sum} / {metric/turnover_ly_for_pre_year} - 1
where turnover_ly_for_pre_year uses:
SELECT SUM({fact/FCT_DAILY_PERFORMANCE.TURNOVER}) FOR PREVIOUS({label/date.year})
The problem: FOR Previous strictly follows the date attribute you specify â in this case date.year. However, your visualization is broken down by Month/Year (a more granular date attribute). Since FOR Previous does not adapt to the visualization's granularity, it may not be returning the values you expect at the monthly level, resulting in a division that produces 0 or near-0. [Functions for Past Periods]
Recommended Fix: Use FOR PreviousPeriod Instead FOR PreviousPeriod adapts to the most granular date attribute in the visualization. Since your chart uses Month/Year, it will automatically shift by month, which is what you want for a monthly YoY trend. [FOR PreviousPeriod]
Update your Last Year metric to:
SELECT SUM({fact/FCT_DAILY_PERFORMANCE.TURNOVER}) FOR PreviousPeriod({label/date.year})
> Important: Even though FOR PreviousPeriod adapts to the visualization's granularity (month), you still need to specify the date dimension (e.g., {label/date.year}) to indicate which date dimension to use, especially if your workspace has multiple date dimensions.
Additional Checks 1. Date filter: Make sure you have a date filter applied to the visualization. If the date filter is set to All time, time-over-time comparison cannot be enabled. [Time-over-Time]
2. Segmentation: Your setup of Trend by = Month/Year and Segment by = Channel Type looks correct for a line chart. Just ensure only one metric is in the Metrics section when using Segment by. [Line Chart]
3. Ratio format: Since your YoY metric is a ratio (division minus 1), make sure the metric format is set to percentage (e.g., ##.##%) so it displays correctly. đ 0 button đ 0 button âšī¸ Tip: Mention @kapa.ai in the thread for follow-ups.
đ Our Support team monitors all messages and will jump in if needed.Joseph Heun
05/27/2026, 6:48 AM