Apparatus for treating a flow of raw water by microbial activity, the apparatus comprising - a volume provided with an inlet for raw water and an outlet for water having been subjected to microbial activity, a biological filter and a trace element dosage device configured to dose a nutrient to microorganisms of the biological filter which are placed in this volume: - the biological filter comprises a filter material including a porous filter material carrying a microbial biomass, the filter material is either stationary relative to the volume or comprises a particulate material, the filter material is inserted in a fluid flow path generated by water flowing in direction from the inlet to the outlet, - the trace element dosage device is positioned upstream of the porous filter material and microbial biomass and is configured to dose trace element(s) to the water flowing through the filter, wherein the trace element dosage device comprises at least one solid structure of a source of trace element(s) at least partly immersed in the water flowing through the filter or at least in contact with the water flowing through the filter by water continuously overflowing the trace element dosage device and at least one solid source of trace element(s) is an electrode of an electrolysis system, the electrolysis system comprises: 1) a system with one metallic electrode and one non-metallic electrode such as a carbon electrode, or 2) a system with two or more metallic electrodes and two or more non-metallic electrodes or 3) a system with one or more pairs of metallic electrodes, further the apparatus comprises a measuring device arranged in the flow path measuring a parameter corresponding to the content of one or more trace elements or to microbial activity which measuring device provides values of the parameter before and/or after the filter. - a volume provided with an inlet for raw water and an outlet for water having been subjected to microbial activity, a biological filter and a trace element dosage device configured to dose a nutrient to microorganisms of the biological filter which are placed in this volume: - the biological filter comprises a filter material including a porous filter material carrying a microbial biomass, the filter material is either stationary relative to the volume or comprises a particulate material, the filter material is inserted in a fluid flow path generated by water flowing in direction from the inlet to the outlet, - the trace element dosage device is positioned upstream of the porous filter material and microbial biomass and is configured to dose trace element(s) to the water flowing through the filter, wherein the trace element dosage device comprises at least one solid structure of a source of trace element(s) at least partly immersed in the water flowing through the filter or at least in contact with the water flowing through the filter by water continuously overflowing the trace element dosage device and at least one solid source of trace element(s) is an electrode of an electrolysis system, the electrolysis system comprises: 1) a system with one metallic electrode and one non-metallic electrode such as a carbon electrode, or 2) a system with two or more metallic electrodes and two or more non-metallic electrodes or 3) a system with one or more pairs of metallic electrodes, further the apparatus comprises a measuring device arranged in the flow path measuring a parameter corresponding to the content of one or more trace elements or to microbial activity which measuring device provides values of the parameter before and/or after the filter. - the biological filter comprises a filter material including a porous filter material carrying a microbial biomass, the filter material is either stationary relative to the volume or comprises a particulate material, the filter material is inserted in a fluid flow path generated by water flowing in direction from the inlet to the outlet, - the trace element dosage device is positioned upstream of the porous filter material and microbial biomass and is configured to dose trace element(s) to the water flowing through the filter, wherein the trace element dosage device comprises at least one solid structure of a source of trace element(s) at least partly immersed in the water flowing through the filter or at least in contact with the water flowing through the filter by water continuously overflowing the trace element dosage device and at least one solid source of trace element(s) is an electrode of an electrolysis system, the electrolysis system comprises: 1) a system with one metallic electrode and one non-metallic electrode such as a carbon electrode, or 2) a system with two or more metallic electrodes and two or more non-metallic electrodes or 3) a system with one or more pairs of metallic electrodes, further the apparatus comprises a measuring device arranged in the flow path measuring a parameter corresponding to the content of one or more trace elements or to microbial activity which measuring device provides values of the parameter before and/or after the filter.