SSAS Tabular model table load from query with #temp table fails
The SQL query can be converted to a stored procedure and then executed as the source SQL statement for the SSAS dimension/fact tables.  As with a typical stored procedure, you can then use temp tables without any problems.  A stored procedure can be called from SSAS by using an EXEC statement with the result set then used in the same manner as one from a view or table would be.

EXEC Schema.SP_Name