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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Bimtng
Frequent Visitor

Bring just the needed dimension data to my document

Hi all.

 

I have a dimension that has a great number of rows. My model has a table of facts that does not need all the rows in the dimension table. The question is: How can I bring to my model just the relationed rows between both tables? I take all the facts, however I would like to bring just the dimension rows connected with the facts, not all of them as I do now.

 

Thanks in advance.

1 ACCEPTED SOLUTION
GilbertQ
Super User
Super User

Hi @Bimtng

 

What you could do, is in your SQL Query, you could write the TSQL for your Dimension table that it only brings the Dimension ID's where they exist in your Fact Table

 

EG:

 

 

Select * 
from DimensionTable
where DimensionID in
   (
     Select Distinct DimensionID
     from FactTable
  )

That result will be your Dimension table will only bring in the related DimensionID from your Fact table.

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

4 REPLIES 4
GilbertQ
Super User
Super User

Hi @Bimtng

 

What you could do, is in your SQL Query, you could write the TSQL for your Dimension table that it only brings the Dimension ID's where they exist in your Fact Table

 

EG:

 

 

Select * 
from DimensionTable
where DimensionID in
   (
     Select Distinct DimensionID
     from FactTable
  )

That result will be your Dimension table will only bring in the related DimensionID from your Fact table.

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

dkay84_PowerBI
Microsoft Employee
Microsoft Employee

Are you using Direct Query or Import for your data?

I do not know if I have understood your question. Both tables are in a SQL Server database.

When you connected to the SQL database, did you choose to import or do direct query?

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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
Top Kudoed Authors