Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Temporary Tables in power bi

Hello,

 

I have an problem with power bi.How we can use temporary tables in power bi?

That means 

I wrote a query like this in power bi while connect the data.

 

select * into #abc from main table

 

select * into #abc1 from 

abc 

  inner join

main table2 

on abc.id=maintable2.id

 

while Iam writing this in power bi first table "abc" is loaded it did not shows any columns

just it shows number of rows effected.

it shows an error 'abc table does not exist' when we use the "abc" table.Is it right to achieve this?

or is there any way?Please suggest.

 

Thanks,

Chunduri

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @Anonymous,

 

There are some error in your second query, when you reference the #abc table, you need to use #abc rather than abc. As both #abc and maintable2 have id column, you need to specify id column. You can modify the query like below: 

 

select * into #abc from Main1

select m2.* into #abc1 from #abc 
inner join Main2 m2
on #abc.id=m2.id
select *from #abc1

Before you run the query in Power BI, make sure the query works in SSMS firstly. 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-qiuyu-msft
Community Support
Community Support

Hi @Anonymous,

 

There are some error in your second query, when you reference the #abc table, you need to use #abc rather than abc. As both #abc and maintable2 have id column, you need to specify id column. You can modify the query like below: 

 

select * into #abc from Main1

select m2.* into #abc1 from #abc 
inner join Main2 m2
on #abc.id=m2.id
select *from #abc1

Before you run the query in Power BI, make sure the query works in SSMS firstly. 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi

May I know if it's possible to get temp table data? Cause I'm using very simple statement, and it not works.

2019-10-30 16_00_33-Microsoft Edge.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.