YOY in table card beast mode

How can i display YOY Sales Data side by side in table card using beast mode. I am using this beast mode to display LY

 

Case when year(DATE_SUB(CURDATE(), interval 1 year)) = year(`Date`) then `Net Sales` end and date selected in table card is This Month

Comments

  • Your Beastmode looks good, but you can't use the card's date selection because it is year specific. In essence when you choose 'This Month' then you filter out all data from last year.

     

    Consider these beastmodes with no date filter:

     

     

    `This Year`
    CASE
    WHEN YEAR(CURRENT_DATE()) = YEAR(`Date`)
    THEN `Net Sales`
    END

    `Last Year`
    CASE
    WHEN YEAR(CURRENT_DATE()) - 1 = YEAR(`Date`)
    THEN `Net Sales`
    END

    `Month` (for filtering)
    CASE
    WHEN MONTH(CURRENT_DATE()) = MONTH(`Date`)
    THEN 'This Month'
    ELSE 'Other'
    END

     

    Then add a FILTER using the new beastmode `Month` and filter to 'This Month' which is not year specific.