Thanks for clarifying @Anonymous.
You can look into creating an app that is embedded into a Power BI report using the custom Power Apps visual. I'm going to give a brief explanation but it's best to see the full docs/community content on it.
In Power BI desktop, insert a custom Power Apps visual. You should be able to import it from AppSource.

Like other visuals in the report, the app will have the context of the rows that are filtered by slicers and selections in other visuals. The table can be referenced with the PowerBIIntegrationObject inside the embedded app in Power Apps. Something like:
PowerBIIntegrationObject.Data
You can filter it and do other things with it as you would any other table in Power Apps.
With the table in Power Apps, you'll need to run a flow in Power Automate that takes the table data and turns it into your file of choice. Making a CSV is not too bad, but making an XLSX file may be more challenging as it's essentially a zip file format.
You would need the flow to create a URL to the file and communicate that back to the app so that it can be launched with the Launch() function in Power Apps.
That's the short of it.
Adding in some friends who can share some resources as this has been done before:
@darogael @RezaDorrani @yashag2255