How to identify which semantic model is executing queries against Azure Synapse SQL pool?

I have multiple semantic models that are connecting to my Azure Synapse SQL data warehouse. I need a way to track which specific model is running queries at any given time. This would help me with monitoring, troubleshooting, and understanding usage patterns.

My current approach involves adding a comment at the start of each query to identify the source:

-- Source: MonthlyFinancialDashboard --

Then I can review these comments in my SQL activity logs. However, implementing this means I need to modify the PowerBI navigation from the simple:

Source{[Schema="Finance",Item="DateDimension"]}[Data]

To a more complex structure like:

ModelID = [ModelIdentifierParam],

Source = Sql.Database("myserver", "warehouse", [Query="-- Source: " & ModelID & " SELECT * FROM Finance.DateDimension "])

This change breaks the automatic navigation feature in PowerBI since I have to use custom SQL instead of direct table references. Before I build this solution from scratch, I want to check if there’s already a standard method or built-in feature for tracking query sources in this scenario.

The Dynamic Management Views in Azure Synapse are another solid option. Query sys.dm_pdw_exec_sessions and sys.dm_pdw_exec_requests to see connection details and client app info. Power BI automatically sends identifying info through these system views.

I’ve had good luck setting up a monitoring query that hits these DMVs periodically - gives you real-time visibility into active connections. The login_name and client_id columns usually have enough info to tell different semantic models apart, especially if they’re using different service accounts or have distinct naming patterns.

Best part? You don’t need to modify your existing Power BI queries at all. You keep the direct table navigation working while still getting the tracking you need.

hey, have u tried changing your PowerBI connection string? u can add an application name param without messing up the nav. just add Application Name=YourModelName to the string and it should pop up in your Synapse logs.