You are passing a string to the @query parameter so it does not know the value of @Threshold. You need to create a string variable and include the actual value. You can then pass that variable to the sp_send_dbmail procedure.
DECLARE @qry varchar(MAX)
SET @qry = 'SELECT Fields FROM Table WHERE DataValue < '
+ cast(@Threshold as varchar) +
' AND LocalDateTime >= DATEADD(hour, -24, SYSDATETIME()) GROUP BY Fields'