With rapid increase in the number of Phasor Measurement Units (PMUs) in the electric grid, massive volumes of monitoring data are expected to overwhelm the data pre-processors at centralized computing facilities. This, along with the requirements of lower latency and increased resilience to data anomalies advocates for distributed architectures for data conditioning and processing. To that end, in this paper, we present a fog-computing-based hierarchical approach for distributed detection and correction of anomalies in PMU data. In our proposed approach, each fog node, responsible for real-time data preprocessing, is dynamically assigned a smaller group of PMU signals with similar modal observabilities using software-defined-networking (SDN). The SDN controller residing at a central node feeds on the modeshapes estimated from the signals recovered at each fog node, for running the PMU-grouping algorithm. Grouping ensures adequate denseness of each signal set and guarantees data recovery under corruption. Also, the grouping is soft-realtime, infrequent, and triggered only upon a change in operating condition and therefore, heavily relieves the computational burden off the central node. The effectiveness of the proposed approach is demonstrated using simulated data from the IEEE 5-area 16-machine test system.