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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
luckygirl
Helper I
Helper I

Importing SQL data to PBI

Hi,

I have very large tables having more than 1 million records and assume they look like following. For a particular application, I am interested only on data regarding customers of prodtype "A". 

luckygirl_0-1743039371547.png

To have a star schema, would below import SQL queries work? And are they the most efficient?

Applications Table : SELECT * FROM Applications WHERE ProdType = 'A'					

 

Alerts Table: 
WITH A_Customer_Codes AS( 
SELECT 
	DISTINCT CustomerID
FROM 
	Alert
WHERE ProdType = 'A'
)
,
Alerts AS (
SELECT
*
FROM Alert
CusID IN  (SELECT CustomerID FROM A_Customer_Codes) 

 I am asking this because If we import alert table as SELECT * FROM Alert and join using CustomerID/CusID, then it will load a huge amount of data. Thanks a lot for your guidance. 

2 ACCEPTED SOLUTIONS
pankajnamekar25
Super User
Super User

@luckygirl 

 

You can try this

SELECT *
FROM Alert
WHERE CusID IN (
SELECT DISTINCT CustomerID
FROM Applications
WHERE ProdType = 'A'
);

 

Thanks,
Pankaj

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

View solution in original post

V-yubandi-msft
Community Support
Community Support

Hi @luckygirl ,

@pankajnamekar25 ,  proposed query efficiently filters the Alert table by selecting customers from the Applications table with ProdType = 'A', meeting your requirement. This method minimizes unnecessary data loading. To enhance performance, please ensure that CustomerID in Applications and CusID in Alert are indexed.

 

Let us know if further optimizations are needed.
If your issue is resolved, please mark it as the accepted solution. This will help others facing a similar issue.

View solution in original post

3 REPLIES 3
V-yubandi-msft
Community Support
Community Support

Hi @luckygirl ,

@pankajnamekar25 ,  proposed query efficiently filters the Alert table by selecting customers from the Applications table with ProdType = 'A', meeting your requirement. This method minimizes unnecessary data loading. To enhance performance, please ensure that CustomerID in Applications and CusID in Alert are indexed.

 

Let us know if further optimizations are needed.
If your issue is resolved, please mark it as the accepted solution. This will help others facing a similar issue.

pankajnamekar25
Super User
Super User

@luckygirl 

 

You can try this

SELECT *
FROM Alert
WHERE CusID IN (
SELECT DISTINCT CustomerID
FROM Applications
WHERE ProdType = 'A'
);

 

Thanks,
Pankaj

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

DAXToTheFuture
New Member

The queries look good.  Depending on your capacity the 1M rows will not be a huge deal.  I would start by trying to load all of it and see how big your PBIX file is after you load the data.  You might be surprised how much you can load in the model and still be efficient and fast.  I find it best practice as well to load more than you may need and then filter it for visuals so you don't leave out something you may potentially need later.  

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors