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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
rocky09
Solution Sage
Solution Sage

Query running properly in SQL navigator but not in Power BI

Hi There,

I have this below query and it is working very well in SQL navigator.  However, I am getting this below error in Power BI.

 

DataSource.Error: ODBC: ERROR [HY000] [Oracle][ODBC][Ora]ORA-00933: SQL command not properly ended

 

Below, is the query.

(select ASSET_ID,T.pno,CREATED_DATE_UTC,CREATED_USER, MODIFIED_USER,u.EAL as EAL_Location,
case
when AS_ID = '1' then 'R'
when AS_ID = '2' then 'y'
when AS_ID = '3' then 'B'
when AS_ID = '4' then 'O'
when AS_ID = '5' then 'G'
end as E_Status,
case
when TSL = '1' then 'Open'
when TSL = '2' then 'Closed'
end as Status,
lead(case 
when AS_ID = '1' then 'R'
when AS_ID = '2' then 'y'
when AS_ID = '3' then 'B'
when AS_ID = '4' then 'O'
when AS_ID = '5' then 'G'
end ) over (partition by ASSET_ID order by RDATE) next_status, RDATE , lead(RDATE)  over (partition by ASSET_ID order by RDATE) next_datum from dbo.trim_request r
join ta_ac d t on t.PID = r.asset_id
join dbo.clients u on u.logon_name = r.CREATED_USER
WHERE r.RDATE > = to_date('01-01-2017','dd-mm-yyyy') AND t.p_oem = 'PK')
select 
case
when AS_ID = '1' then 'R'
when AS_ID = '2' then 'y'
when AS_ID = '3' then 'B'
when AS_ID = '4' then 'O'
when AS_ID = '5' then 'G'
end as E_Status, next_status, datum, next_datum, next_datum - datum diff from r
where status in ('B', 'y', 'R') and next_status = 'G'
order by datum

anyone has Idea?

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @rocky09,

 

After a few research, I found that there could be a few cause to this issue:

Could you go to check if it helps in your scenario?

 

In addition, if the issue persists, I would suggest you create a support ticket on Power BI Support page for better assistance. Smiley Happy

 

Regards

View solution in original post

1 REPLY 1
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @rocky09,

 

After a few research, I found that there could be a few cause to this issue:

Could you go to check if it helps in your scenario?

 

In addition, if the issue persists, I would suggest you create a support ticket on Power BI Support page for better assistance. Smiley Happy

 

Regards

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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