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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
sfink22
Helper I
Helper I

Dividing across tables with a measure

I currently have four tables in a star schema with "Recipe" table as my link between all three tables. All relationships are 1:Many.

"Recipe" table:

RecipeRecipe Code

 

I have a "Component Mix" table that shows the component breakdown of each recipe and the percentage for each component. i.e. Recipe #1 is 50% A, 25% B, 25% C, Recipe #2 is 60% A, 30% D, 10% E, etc.

"Component Mix" table:

RecipeComponent% Mix

 

My "Volume" table has a list of recipes with their corresponding volume. I created a measure that takes the volume number from the "Volume" table and mulitplies it by the component percentage from a "Component Mix" table. This gives me volume by component. 

"Volume" table (also includes the Component Volume measure):

RecipeVolumeSite

 

My last table is "Rates". It has the production rate for each component by production site. I need to get the Component Volume and divide it by its corresponding Rate, which will give me time to produce the given volume. Since some components are shared between recipes, I will also need it to aggregate time to produce for every component by site.

"Rates" table:

RecipeComponentSiteRate

 

What I'd like to end up with:

ComponentSite 1Site 2
A[Site 1's rate for Component A * Site 1's volume of Component A][Site 2's rate for Component A * Site 2's volume of Component A]
B[Site 1's rate for Component B * Site 1's volume of Component B][Site 2's rate for Component B * Site 2's volume of Component B]
Cetc. 

 

Is this possible?

2 REPLIES 2
v-deddai1-msft
Community Support
Community Support

Hi @sfink22 ,

 

Would you please show us some sample data or sample pbix ? Then we can help you more accurately.

 

Best Regards,

Dedmon Dai

lbendlin
Super User
Super User

This sounds like the exact opposite of a good data model 🙂  Ideally multiple dimensions point to a single fact table.  In your case a single dimension seems to point to multiple facts.  That makes computations between the facts tricky as they have to go through the dimension, which can introduce ambiguity.

 

Think about your data some more - maybe you can come up with different relationships?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.