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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors