This paper focuses on solving Η2 and Η∞ filtering problems for discrete-time switched affine systems. A newly proposed Lyapunov stability analysis method in which considered that the system will converge to limit cycles instead of equilibrium points or regions was used in solving such problems for the first time. In the stability analysis of a discrete-time affine filtering error system, an observer-based filter and its corresponding switching function can be obtained by solving the linear matrix inequalities. Furthermore, it is proved that the Η2 and Η∞ guaranteed cost is upper bounded, the upper boundaries are formulated by solving an optimization problem. Finally, two numerical examples are given to verify the theory.