Hi @Anived ,
You can save a blank excel file or an excel file with the table headers in a SP Doc library (name it as Template File) and create a new file in a separate folder (Just to distinguishing it better) using the File content of this Template File.
Now write your filtered data from flow into this new file using Office Scripts or using the Add a Row action of excel in Power Automate. And delete the old file.
This is one approach.
Another approach would be ,
Create a new worksheet in the existing File itself and write the data in the new worksheet , and delete the old worksheet. (Here as well you can use Office script for better performance.)
If this helps , please give this a thumbs up and mark this as a solution.
Thanks,
Sanmesh