Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
iain_robertson
Regular Visitor

Testing Database Changes Against Suite of Reports

Hi All, 

 

I've inherited a mature SQL Server data environment that has been completely uncontrolled for a long time. It had been run as a single production server environment, i.e. no dev or test servers. It contains significant amounts of redundant code and objects that I'd like to clear out. But. We also have a large PBI estate, spread across 20+ workspaces and with many reports run on an ad-hoc and infrequent basis. 

 

I have set up a test server that mirrors my production environment. As I remove what I believe to be redundant objects, I need to verify that this won't break any of the existing PBI reports by executing them against the test server. 

 

Given the volume of reports involved, I don't want to do this manually. So how can I do this programatically? 

 

I've done some investigation of the PBI API, but this hasn't helped. I was hoping that I could simply extract the object names / query definitions from the reports and then execute these against the test server. But this doesn't appear to be possible. 

 

I have implemented an extended events session on the production server to trap queries generated by PBI. But this won't capture everything - only the reports that are executed in the period that the session is running for. 

 

This must be a solvable problem. Thoughts and advice appreciated. 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Use the Scanner API to harvest all queries for the Power BI data sources. That will tell you which SQL server tables, views etc are contributing.

View solution in original post

2 REPLIES 2
iain_robertson
Regular Visitor

That did the trick, thank you. For future viewers of this topic, I needed to create a scan request via a PostWorkspaceInfo call, wait for this to complete successfully and then get the results using GetScanResult. This returns a huge amount of very useful information about your PBI setup. 

 

Admin - WorkspaceInfo PostWorkspaceInfo - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Admin - WorkspaceInfo GetScanResult - REST API (Power BI Power BI REST APIs) | Microsoft Learn

lbendlin
Super User
Super User

Use the Scanner API to harvest all queries for the Power BI data sources. That will tell you which SQL server tables, views etc are contributing.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.