Can't use parameters in custom SQL when joining 2 datasources

Hi

I have found a workaround for my problem.
The original objective was to select select a person and then being able to see all the cars he owns.

I order to do that, I created 2 different datasets in Direct query : 1 for the Person and the other for Car.

Then, in the visuals, I created a table to display the Person’s name and id (hidden).

I then added a filter action on this table that filters my cars visuals with the field “id” from Person.
I made sure that the field mapping was correct and voila.

I am now trying to see if I can select several persons at a time on a table, and I have found this very interesting workaround :

How can I select multiple lines from a table? (and how could I then DESELECT those items to exclude them form the analysis?) - Question & Answer - Amazon QuickSight Community

Have a good day everyone