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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mdubose
Helper I
Helper I

Create custom query in Desktop

I have a need to replace Business Objects reports with Power BI.  In Business Objects, you're able to create derived tables which allows you to enter SQL expresssions.  Is there a way to do the same in Power BI Desktop?  I'm connecting to a mySQL database via ODBC connection. Thanks in advance.

 

EDIT:

My SQL expressions are complex. They include subqueries. For example:

select a.id, namefirst, nameLast from (

(select id, clobValue as nameFirst from table A where name = 'nameFirst') a,

(select id, clobValue as nameLast from table A where name = 'nameLast') b

)

where a.id = b.id

1 ACCEPTED SOLUTION

Padycosmos_0-1673883160390.png

Expand Advanced to get the SQL statement window

View solution in original post

7 REPLIES 7
Padycosmos
Solution Sage
Solution Sage

Hi @Padycosmos ,

In this video, it demonstrates added a SQL query when connecting to a SQL data source. I'm connecting via ODBC to a MySQL data source so I do not have the option to enter the query this way.

lbendlin
Super User
Super User

You can run multiple queries against the same data source (and they can be custom SQL). Each query will appear as a table in Power BI if you choose to load it.

Hi @lbendlin ,

 

Where in Desktop, can I create this query?

You do that in the ETL portion called Power Query Editor.

Hi @lbendlin,

 

Using this feature in Desktop is new to me, can you provide a screenshot of where in Power Query Editor, I could enter the query?  Thank you.

Padycosmos_0-1673883160390.png

Expand Advanced to get the SQL statement window

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.