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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
LV6001
New Member

How can we import data from multiple sql queries returning the same number and type of columns into

SQL to DAX 

 

How can we import data from multiple sql queries returning the same number and type of columns into a new table using power bi?
For example i have 10 sql select queries. They return 3 columns Result, Tests, Quantity
I want to create a new table in power bi with columns Result, Tests, Quantity. This new table should be populated from the 3 sql queries

1 ACCEPTED SOLUTION

Hi @AntrikshSharma Thanks. Coincidently, I saw your Youtube videos today 😊

I will try with Union All 

Another conern would be that each of those queries query on a fact tables with high volume. 

Is there another performant way to get the result of the individual sql queries in the target table.

This might be for later but I also wish to schedule this run/refresh every two weeks

View solution in original post

4 REPLIES 4
AntrikshSharma
Super User
Super User

@LV6001 Use UNION ALL to combine them first?

Hi @AntrikshSharma Thanks. Coincidently, I saw your Youtube videos today 😊

I will try with Union All 

Another conern would be that each of those queries query on a fact tables with high volume. 

Is there another performant way to get the result of the individual sql queries in the target table.

This might be for later but I also wish to schedule this run/refresh every two weeks

@LV6001 You can create a View that stores all queries. You can also try to create a materialized/indexed view as well.

CREATE SCHEMA PowerBI
GO

CREATE VIEW PowerBI.CombinedSales
AS
	SELECT * 
	FROM FactSales1
		UNION ALL
	SELECT * 
	FROM FactSales2
		UNION ALL
	SELECT * 
	FROM FactSales3

 https://www.sqlshack.com/sql-server-indexed-views/

Thank you  @AntrikshSharma !!

I am able to achieve the required using UNION ALL 

I am now trying to schedule a refresh on the report server 

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.