Load SQL Query to Power BI

Job ID: 32697365

Budget: $10 – $30 USD

I have a query that uses temp tables and variables. I want to load the out put in Power BI and generate reports. Power BI throws the error when declared variables used in the SQL . " the variable name '@yearmonth' has already been declared. variable names must be unique within a query batch.
I tried using blank query and declare those variables in Power bi but not successful.
Related categories: SQL Microsoft PowerBI