@Galih Thanks for the question.
This requirement may be very complex to achieve in ADF dataflows, incase even if it is possible, it will be a cumbersome solution. I agree with @Vinodh247-1375 suggestion and would encourage to take different approach using Synapse spark Notebooks or Databricks spark notebooks by writing your own logic.
If you would like to achieve this in data factory itself, then you may consider using Custom Activity or Azure function activities in which you can execute your own custom logic for transforming your complex data.
I even had a discussion with internal experts on this requirement and the other recommendations apart from Synaspe/Databricks spark notebooks is to give a try with PowerBI dataflow or Fabric dataflow, as it is not possible in Mapping Dataflow in ADF
Hope this info helps.
Thank you
Please don’t forget to Accept Answer
and Yes
for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.