Azure Application Insights Queries to share the same variable

Viewed 2529

I have an AI dashboard with a number of queries displaying the last run results. Every query does something like that:

let lastRun = customMetrics
| where session_Id != ''
| top 1 by timestamp desc
| project session_Id;

customMetrics
| where session_Id in (lastRun)
...

As already mentioned, results of queries (last run) are pinned to the dashboard.

Question is: Is there a way to inject SessionId (which is now calculated every time as lastRun local variable) without customising/duplicating the query? If not, can I at least modify only one query producing the sessionId in one place and the other queries (in separate scope) to update?

E.g. on a dashboard I type the sessionId I'm interested at and the sessionId passed to queries as a parameter? And ideally, the whole dashboard is refreshed.

Can I do it without Power BI?

1 Answers
Related