In this paper we consider S-threshold functions defined on not necessarily binary input. By S-threshold function, in an arbitrary dimension we mean a function which can be written as a linear combination of monomials from a predefined set. First, we determine sets of discrete moments which uniquely determine such functions. Based on these, we derive a generic formula for the upper bound of the functions considered. The formula is generic because it works in all dimensions, on any input size, and for any set of monomials used to define certain S-threshold function. Even though the formula is very generic it gives some improvements of the well-known results.