Power exhaust is a crucial issue for next step fusion devices since the heat flux to first wall elements has to be kept below a technically feasible limit. A crucial parameter in this context is the perpendicular heat flux decay length in the scrape-off layer (SOL). In this paper, a direct measurement of the midplane decay length in the poloidal divertor tokamak ASDEX Upgrade by continuously varying the magnetic configuration from a lower single null (SNL) through a double null configuration to upper single null (SNU), i.e., switching of the particle and heat flux continuously from the lower to the upper divertor, while monitoring the divertor particle and heat flux in the lower divertor is presented. The decrease of the signal measured at the outer lower divertor target plotted versus the midplane distance of the two separatrices results in e-folding lengths for the midplane heat flux. The decay lengths found are comparable to decay lengths derived from heat flux profiles measured at the divertor plates and mapped to the midplane.