I am trying to calculate the %age change in headcount with respect to the previous vs this month but by using below beast mode I am not getting any results in the trend line. It gives 0 as a value.
( (SUM(CASE WHEN MONTH(Date
) = MONTH(CURDATE()) THEN Headcount
END) / COUNT(DISTINCT(CASE WHEN MONTH(Date
) = MONTH(CURDATE()) THEN Date
END))
) - (
SUM(CASE WHEN MONTH(Date
) = MONTH(CURDATE())-1 THEN Headcount
END) / COUNT(DISTINCT(CASE WHEN MONTH(Date
) = MONTH(CURDATE())-1 THEN Date
END))) )
/ NULLIF((SUM(CASE WHEN MONTH(Date
) = MONTH(CURDATE())-1 THEN Headcount
END) / COUNT(DISTINCT(CASE WHEN MONTH(Date
) = MONTH(CURDATE())-1 THEN Date
END))))