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.