cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tiberwood Frequent Visitor
Frequent Visitor

Problem with a Sentence

Hello people this is my first post, i hope to get the answer for my question.

I have this SQL sentence:

 

with resultado as
(select top 12 *
from dbo.EVOL_SO_WXP
order by ID desc
union
select top 12 *
from dbo.EVOL_SO_W10
order by ID desc
union
select top 12 *
from dbo.EVOL_SO_W8
order by ID desc
union
select top 12 *
from dbo.EVOL_SO_W7
order by ID desc
union
select top 12 *
from dbo.EVOL_SO_W2000
order by ID desc
union
select top 12 *
from dbo.EVOL_SO_W2003
order by ID desc
union
select top 12 *
from dbo.EVOL_SO_W2008
order by ID desc
union
select top 12 *
from dbo.EVOL_SO_W2012
order by ID desc
)
select
ID,
[Sistema operativo],
Mes + ' ' + Año [Mes],
Total
from resultado order by ID

 

When I run this SQL sentence Power BI send me this errorPowerBi..JPG

 

But if I run the same Sentence in SQL Server it works, How can I fix this?

Thanks for the help!!!

1 ACCEPTED SOLUTION

Accepted Solutions
Tiberwood Frequent Visitor
Frequent Visitor

Re: Problem with a Sentence

Thanks for your help but I solve it, the solution was don't do that in DirectQuery mode, in Import mode I execute the Store Procedure and it works!!

 

2 REPLIES 2
Super User
Super User

Re: Problem with a Sentence

Hey,

 

have a look here

https://community.powerbi.com/t5/Desktop/Custom-query-with-CTE-not-supported-bug/m-p/80522

,currently the usage of CTE is not supported Power BI

 

Two ways to circumvent this "limitation

  1. create views in SQL Server and use these in Power BI
  2. use Power Query to rebuild the logic of your CTE

My recommendation: 1.

 

Regards

Tom

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
Tiberwood Frequent Visitor
Frequent Visitor

Re: Problem with a Sentence

Thanks for your help but I solve it, the solution was don't do that in DirectQuery mode, in Import mode I execute the Store Procedure and it works!!

 

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

Top Ideas
Users Online
Currently online: 264 members 3,127 guests
Please welcome our newest community members: