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

Join 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.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.