When "Export Data" is turned off, the following code can be used to programmatically retrieve data from a Power BI dashboard:
Power BI REST API: Utilize the API to programmatically access the dataset or generate reports.
Power Automate: Create flows that can access Power BI data and export it to other locations (such as Excel, SQL, etc.) to automate the extraction process.
Power BI Desktop: If you have access, open the.pbix file and take data straight out of the model.
Python/R Scripts: If permitted, extract and modify data in Power BI using Python or R.
Web scraping: As a last resort, extract the dashboard's visible data using web scraping tools like Selenium.
Access the data straight from the underlying source (such as SQL Server) if you're using DirectQuery.