Update Power BI parameter with user selected value that is embedded in SQL query

I've got a complex TSQL query being run to bring in one of my data sets that I've set up with a Power BI parameter.

Is there a way I can populate this parameter when users make a selection from a table - can this populate the parameter which in turn changes the second table visualisation?

There is no easy way to link the queries together via the model.

Have attached screenshot of a portion of the report. I want the user to make a selection from the top table which then populates the Power BI parameter which is used in SQL query to retrieve the data for the bottom table.

enter image description here

Thanks! Matt