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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
flaviosouzaab
Regular Visitor

Data reduction in dimension tables

Hi,

I have an Excel spreadsheet that connects to a SQL Server database to obtain data from a DW, my difficulty is in keeping in the dimension tables only the records that are present in the fact table, users see different data when accessing the spreadsheet, so the Dimensions should reflect the data according to what is in fact.

 

My attempt was as follows (I'll give an example with the customer dimension):

1) I create a table in buffer with the ids of the clients that are in fact.

2) In the customer dimension I do an inner join in this buffer table created above so that the dimension only has the keys existing in the fact.

 

But when I do that, the data loading takes a long time, the impression I have is that the fact table is loaded in each dimension over and over again.

How can I do this type of transformation in power query?

1 ACCEPTED SOLUTION
watkinnc
Super User
Super User

If these are from the same database, a mere inner join from dimension to fact would normally be your best option (without the buffer, which causes the problem you describe above.

 

You could also try a buffered list instead of table, by making a query that gets the distinct values from the customer column of the fact table, like List.Distinct(Fact[Customer])

 

Name that query FilterValues.

 

Now when you make your fact table query, filter like:

 

Table.SelectRows(PriorStepOrTableName, each List.Contains(List.Buffer(FilterValues), [CustomerColumnNameFromThisFactTable]))

 

--Nate

 

 


Try using a buffered list instead of a buffered table:

 

Table.SelectRowsFactTabls


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

View solution in original post

2 REPLIES 2
watkinnc
Super User
Super User

If these are from the same database, a mere inner join from dimension to fact would normally be your best option (without the buffer, which causes the problem you describe above.

 

You could also try a buffered list instead of table, by making a query that gets the distinct values from the customer column of the fact table, like List.Distinct(Fact[Customer])

 

Name that query FilterValues.

 

Now when you make your fact table query, filter like:

 

Table.SelectRows(PriorStepOrTableName, each List.Contains(List.Buffer(FilterValues), [CustomerColumnNameFromThisFactTable]))

 

--Nate

 

 


Try using a buffered list instead of a buffered table:

 

Table.SelectRowsFactTabls


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

Thank you very much for the answer, it worked.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors