Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi, I have a query that looks something like this:
DEFINE enddate = ADD_MONTHS(TRUNC(current_date), -1);
SELECT *
FROM TABLE1
WHERE TRUNC(local_date) >= &enddate
UNION
SELECT *
FROM TABLE2
WHERE TRUNC(local_date) >= &enddate
It is working in Oracle SQL Developer but when I run it in Power BI, the following message is returned:
"Oracle: ORA-00900: invalid SQL statement"
Is there any way to modify this query for it to run in Power BI? I think the Define part is causing this error.
I have tried to remove the semicolon (;) but it is still not working.
Thank you
Solved! Go to Solution.
Hi @Anonymous
With reference to the information provided by you, the following is the case description: You have an error running a query in Power Bi, but the query runs fine in Oracle SQL Developer.
You can first try to import the two tables into Power Bi separately, and then do the UNION operation in Power Bi.
For the usage of the UNION function you can refer to the following link: https://learn.microsoft.com/en-us/dax/union-function-dax
If I've misunderstood you, please provide more detailed information. We can better understand the problem and help you. Show it as a screenshot or excel. Please remove any sensitive data in advance.
Best Regards,
Community Support Team _Yuliax
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
With reference to the information provided by you, the following is the case description: You have an error running a query in Power Bi, but the query runs fine in Oracle SQL Developer.
You can first try to import the two tables into Power Bi separately, and then do the UNION operation in Power Bi.
For the usage of the UNION function you can refer to the following link: https://learn.microsoft.com/en-us/dax/union-function-dax
If I've misunderstood you, please provide more detailed information. We can better understand the problem and help you. Show it as a screenshot or excel. Please remove any sensitive data in advance.
Best Regards,
Community Support Team _Yuliax
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
78 | |
58 | |
36 | |
33 |
User | Count |
---|---|
93 | |
59 | |
56 | |
49 | |
41 |