The increasing share of fluctuating renewable energy generation in the energy system increases the need for flexibility options. Building energy systems (BES) with their corresponding thermal energy storages (TES) can be one option for supplying flexibility. To use this option efficiently, a framework to quantify the flexibility of the BES is necessary. It is found that the flexibility of a BES can hardly be described with one single flexibility indicator. Therefore, this paper develops a method to analyze the flexibility of BES in terms of time, power and energy. Different influencing factors are considered, like the heat generator and the thermal storage size. Additionally, the option to aggregate the different flexibility measures on a city district level is addressed. This is necessary as single buildings have a minor impact on higher level energy systems. Finally, a comparison to other flexibility options like battery storage is discussed.