Forum Discussion
Modeling and relation
Hello, I have a problem with the dimensions. navigate the product ID more precisely.
I have product databases in different structures.
The warehouse program groups products according to the order number, e.g. 256, 452, 526, etc.
Unfortunately, I also have products that have variants, e.g.
125-1, 125-2, 125-3.
The product table connects to various fact tables (e.g. cost tables), which show data for SKU 125 without dividing them into variants.
How to properly build the model so that the data is shown in the variant dimension.
I have a relationship at the moment
product table(sku with variant) -> cost table(sku without variant)
Unfortunately, as a result of this, the costs are not correctly overwritten to all skus.
How to solve this problem, first of all how to build relationships correctly? Can the problem of attributing costs to SKUs be attributed proportionally using a measure?
3 Replies
- IdrissshatilaSuper User
Hello s_kula ,
First of all, on how to build a relationship correctly, try looking at the star schema modeling.
https://learn.microsoft.com/en-us/power-bi/guidance/star-schema
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
- s_kulaHelper I
Thank you for the information, I have read the guidelines but I still do not understand exactly how to create an association key to be able to link products with costs.
If I create a column sku2 in the product table and link it with the sku from the cost table in which there will be items without variants, the relation will have a many-to-many condition, and this will not be good.product table
sku sku2
1018-1 1018 1018-2 1018 1018-3 1018 1019-1 1019 1019-2 1019 1019-3 1019 1037-1 1037 1037-2 1037 106-1 106 106-2 106 106-3 106 106-4 106 106-5 106 1079-1 1079 1079-2 1079 1088-2 1088 1154-1 1154 1154-2 1154 116-1 116 116-2 116 116-3 116 116-4 116 116-5 116 116-6 116 117-1 117 1179-1 1179 1179-2 1179 1179-3 1179 1179-4 1179 1184-1 1184 1184-2 1184 1184-3 1184 1203-1 1203 1203-2 1203 1204-1 1204 1204-2 1204 1205-1 1205 1205-2 1205 1205-3 1205 1205-4 1205 1209-1 1209 1209-2 1209 1223-1 1223 1223-2 1223 1223-3 1223 1225-1 1225 1225-2 1225 1225-3 1225 1233-1 1233 1238-1 1238 1238-2 1238 1238-3 1238 124-1 124 124-2 124 125-1 125 126-1 126 1267-1 1267 1267-2 1267 1267-3 1267 1268-1 1268 1268-2 1268 1270-1 1270 1270-2 1270 1270-3 1270 127-1 127 128-1 128 129-1 129 1302-1 1302 1302-2 1302 133-1 133 133-2 133 133-3 133 1337-1 1337 1337-2 1337 1337-3 1337 1337-4 1337 1337-5 1337 1338-1 1338 1338-10 1338 1338-2 1338 134-1 134 134-2 134 134-3 134 1343-1 1343 1343-2 1343 1343-3 1343 1345-1 1345 1345-2 1345 1348-1 1348 1348-2 1348 1348-3 1348 1349-1 1349 1349-2 1349 1349-3 1349 1349-4 1349 1349-5 1349 135-1 135 135-10 135 135-11 135 135-12 135 135-13 135 135-14 135 135-15 135 135-16 135 135-2 135 135-3 135 135-4 135 135-5 135 135-6 135 135-7 135 135-8 135 135-9 135 1374-1 1374 1374-2 1374 1374-3 1374 1379-1 1379 1379-2 1379 138-1 138 138-3 138 138-4 138 138-5 138 138-6 138 1402-1 1402 1402-2 1402 142-1 142 142-2 142 142-3 142 143-1 143 143-2 143 cost table
sku cost
106 0,93 106 0,59 106 0,19 1079 0,71 1079 0,58 1088 0,64 1154 0,27 1154 0,4 116 0,31 116 0,76 116 0,94 116 0,24 116 0,95 116 0,35 117 0,4 1179 0,84 1179 0,82 1179 0,15 1179 0,16 1184 0,86 1184 0,28 1184 0,42 1203 0,96 1203 0,44 1204 0,21 1204 0 1205 0,39 1205 0,64 1205 0,04 1205 0,58 1179 0,16 1179 0,87 1184 0,41 1184 0,63 1184 0,63 1203 0,39 1203 0,31 1204 0,02 1204 0,24 1205 0,26 1205 0,96 1205 0,42 1205 0,53 1209 0,18 1209 0,21 1223 0,84 1223 0,03
- AnonymousNot applicable
You have mutiple of the same values in both tables so it won't connect this way . You could make all the SKU's like 1018-1 and 1018-2 because they will identify all the 1018 SKU different. You should look at creating a key column like the first SKU column to identify each row different.