Nowadays, education requires changes in the teaching and learning processes, through the implementation of innovative and motivating pedagogical actions, owing to the existing needs in society. Education, owing to the current needs of society, requires changes in the teaching and learning processes through the implementation of innovative and motivating pedagogical actions. The main objective of this study is to evaluate the effectiveness of the collaborative method, based on the Harry Potter theme, with respect to the traditional method in the first year of Obligatory Secondary Education for the learning of geometric figures in the subject of mathematics. For this purpose, a quasi-experimental, quantitative, descriptive, and correlational study has been designed, using a standardized questionnaire as a technique to collect information. The sample is composed of 236 students from the first year of Obligatory Secondary Education distributed in eight groups (four control and four experimental) from a public high school in the city of Cádiz (Spain). The tests carried out show that collaborative learning generates improvements in the attitudes and mathematical dimensions. Therefore, the collaborative method, developed by means of the Harry Potter theme for students in the first year of Compulsory Secondary Education in the subject of mathematics, causes a better attitude of the student towards the teaching and learning process. Furthermore, it facilitates the acquisition of mathematical contents related to geometry, which does not directly affect the students’ grades because, although those of the experimental group are better than those obtained by the control group, the differences between the two are minimal.