Hello Zain Mahmood,
maybe, you can try using a matrix cube in your dataflow. To better understand, could you please send me a screenshot of the Cube Structure/Procedure Steps?
Regards, Daniele