In this scenario, since you have two tables without any relationship, we can first merge these two tables and then do the distance calculation with M language in Query Editor. The link provided by @sdjensenis very useful.
I assume the two tables are like below. Please refer to following steps.
In Query Editor, add 2 custom columns for each table. Make sure the Data Type is ‘Decimal Number’.