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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
mmcanelly
Helper I
Helper I

Monitoring queries from Power BI Service using Extended Events in SSMS

I'm working on setting up monitoring of my queries from the Power BI service to SQL Server each time a semantic model refreshes. I'm using SSMS v18.12, and it looks like Extended Events in SSMS can do what I need. The only piece I can't figure out is how to identify which dataset/semantic model each query is coming from.

 

Currently my setup is like this:

  • Monitoring sql_batch_starting and sql_batch_completed events
  • Filtering on client_hostname field to only get events for queries coming from the Power BI service
  • Tracking sql_text, database_name, and username fields

Does anybody know if there's any event or field within Extended Events that would identify which semantic model in the Power BI service each request is coming from?

1 ACCEPTED SOLUTION

Hi,@mmcanelly 

After connecting to SQL Server Profiler, you need to open the corresponding report in Power BI Service and click refresh in the upper right corner.

vfenlingmsft_0-1721283699934.png

 

 

Then go back to SQL Server Profiler to find the statement in the red box.

vfenlingmsft_1-1721283768705.png

 

And then pull the SQL statement to the bottom to find the DatasetId.

vfenlingmsft_2-1721283804764.png

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.


Best Regards,
Fen Ling,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

6 REPLIES 6
mmcanelly
Helper I
Helper I

Thank you @v-fenling-msft. I tried replicating what you have here in Profiler, but I'm not seeing the DatasetID (or the other parameters that you show in red in your screenshot). My SQL:BatchStarting event just shows the query itself without any IDs included. Are you doing something on the Power BI end of things to pass that DatasetID in when the query runs?

Hi,@mmcanelly 

 

You need to open SQL Server Profiler in SSMS first.

vfenlingmsft_2-1721200700882.png

 

vfenlingmsft_3-1721200728494.png

 

 

Then go to Power BI Service and click on refresh.

vfenlingmsft_0-1721200571654.png

 

Then go back to SQL Server Profiler to find the place I have boxed in the picture, and after that drop down the SQL below to find the DatasetId:

vfenlingmsft_1-1721200646294.png

 

Finally, open the semantic model in Power BI Service and find the corresponding semantic model that performs the refresh by using the datasetId in the address bar.

vfenlingmsft_4-1721200819993.png

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.


Best Regards,
Fen Ling,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi @v-fenling-msft, I followed your steps, but I'm not seeing the DatasetId or any of the other fields that you show in your screenshot. Mine is just showing the query that ran from the Power BI refresh, without any additional information to identify the dataset.

 

mmcanelly_0-1721248465538.png

Did you have to set something additional up in Power BI to include the dataset ID when it sends the query?

Hi,@mmcanelly 

After connecting to SQL Server Profiler, you need to open the corresponding report in Power BI Service and click refresh in the upper right corner.

vfenlingmsft_0-1721283699934.png

 

 

Then go back to SQL Server Profiler to find the statement in the red box.

vfenlingmsft_1-1721283768705.png

 

And then pull the SQL statement to the bottom to find the DatasetId.

vfenlingmsft_2-1721283804764.png

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.


Best Regards,
Fen Ling,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

I should also mention that we don't have a Premium capacity and are doing everything with Pro licenses, and it looks like you might be using Premium based on the ApplicationName in your screenshot. I'm not sure if that difference is relevant or not.

v-fenling-msft
Community Support
Community Support

Hi,@mmcanelly 

I am glad to help you.  

 

According to your description, you want to know how to identify which semantic model a Power BI Service request is coming from? 

 

If I understand you correctly, then you can refer to my solution. 

 

You can use SQL Server Profiler for tracing, through which you will get the DatasetId, ReportId, and VisualId corresponding to the executed operation: 

vfenlingmsft_0-1721110509557.png

 

 

vfenlingmsft_1-1721110509562.png

 

Then in the address bar of Power BI, you can find the corresponding DatasetId. Corresponding the DatasetId, you can see which semantic model your request in Power BI Service corresponds to. 

vfenlingmsft_2-1721110528143.png

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.


Best Regards,
Fen Ling,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

"); $(".slidesjs-pagination" ).prependTo(".pagination_sec"); $(".slidesjs-pagination" ).append("
"); $(".slidesjs-play.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-stop.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-pagination" ).append(""); $(".slidesjs-pagination" ).append(""); } catch(e){ } /* End: This code is added by iTalent as part of iTrack COMPL-455 */ $(".slidesjs-previous.slidesjs-navigation").attr('tabindex', '0'); $(".slidesjs-next.slidesjs-navigation").attr('tabindex', '0'); /* start: This code is added by iTalent as part of iTrack 1859082 */ $('.slidesjs-play.slidesjs-navigation').attr('id','playtitle'); $('.slidesjs-stop.slidesjs-navigation').attr('id','stoptitle'); $('.slidesjs-play.slidesjs-navigation').attr('role','tab'); $('.slidesjs-stop.slidesjs-navigation').attr('role','tab'); $('.slidesjs-play.slidesjs-navigation').attr('aria-describedby','tip1'); $('.slidesjs-stop.slidesjs-navigation').attr('aria-describedby','tip2'); /* End: This code is added by iTalent as part of iTrack 1859082 */ }); $(document).ready(function() { if($("#slides .item").length < 2 ) { /* Fixing Single Slide click issue (commented following code)*/ // $(".item").css("left","0px"); $(".item.slidesjs-slide").attr('style', 'left:0px !important'); $(".slidesjs-stop.slidesjs-navigation").trigger('click'); $(".slidesjs-previous").css("display", "none"); $(".slidesjs-next").css("display", "none"); } var items_length = $(".item.slidesjs-slide").length; $(".slidesjs-pagination-item > button").attr("aria-setsize",items_length); $(".slidesjs-next, .slidesjs-pagination-item button").attr("tabindex","-1"); $(".slidesjs-pagination-item button").attr("role", "tab"); $(".slidesjs-previous").attr("tabindex","-1"); $(".slidesjs-next").attr("aria-hidden","true"); $(".slidesjs-previous").attr("aria-hidden","true"); $(".slidesjs-next").attr("aria-label","Next"); $(".slidesjs-previous").attr("aria-label","Previous"); //$(".slidesjs-stop.slidesjs-navigation").attr("role","button"); //$(".slidesjs-play.slidesjs-navigation").attr("role","button"); $(".slidesjs-pagination").attr("role","tablist").attr("aria-busy","true"); $("li.slidesjs-pagination-item").attr("role","list"); $(".item.slidesjs-slide").attr("tabindex","-1"); $(".item.slidesjs-slide").attr("aria-label","item"); /*$(".slidesjs-stop.slidesjs-navigation").on('click', function() { var itemNumber = parseInt($('.slidesjs-pagination-item > a.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); });*/ $(".slidesjs-stop.slidesjs-navigation, .slidesjs-pagination-item > button").on('click keydown', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); var itemNumber = parseInt($('.slidesjs-pagination-item > button.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); }); $(".slidesjs-play.slidesjs-navigation").on('click', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); }); $(".slidesjs-pagination-item button").keyup(function(e){ var keyCode = e.keyCode || e.which; if (keyCode == 9) { e.preventDefault(); $(".slidesjs-stop.slidesjs-navigation").trigger('click').blur(); $("button.active").focus(); } }); $(".slidesjs-play").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-stop").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-play")) { $(".slidesjs-stop").focus(); } } }); $(".slidesjs-stop").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-play").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-stop")) { $(".slidesjs-play").focus(); } } }); $(".slidesjs-pagination-item").keydown(function(e){ switch (e.which){ case 37: //left arrow key $(".slidesjs-previous.slidesjs-navigation").trigger('click'); e.preventDefault(); break; case 39: //right arrow key $(".slidesjs-next.slidesjs-navigation").trigger('click'); e.preventDefault(); break; default: return; } $(".slidesjs-pagination-item button.active").focus(); }); }); // Start This code is added by iTalent as part of iTrack 1859082 $(document).ready(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); $("#tip2").attr("aria-hidden","true").addClass("hidden"); $(".slidesjs-stop.slidesjs-navigation, .slidesjs-play.slidesjs-navigation").attr('title', ''); $("a#playtitle").focus(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").mouseover(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").blur(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#playtitle").mouseleave(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#play").keydown(function(ev){ if (ev.which ==27) { $("#tip1").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); $("a#stoptitle").focus(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").mouseover(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").blur(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").mouseleave(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").keydown(function(ev){ if (ev.which ==27) { $("#tip2").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); }); // End This code is added by iTalent as part of iTrack 1859082
Top Solution Authors