Forum Discussion
DC2024
2 years agoFrequent Visitor
Struggling with creating correct data model - help please!
Hi all, Sorry - I'm sure this is incredibly simple but I am struggling with the best way to set up my data model so that I can get proper insights. Hope the below makes sense, let me know if anyt...
- Anonymous2 years ago
Hi DC2024 ,
You can create a separate dimension table for stores, products and date.
For example:
Fact Table:
Product dimension table:
Store dimension table:
Date dimension table:
DateTable = ADDCOLUMNS( CALENDAR(MIN('Fact Table'[Date]),MAX('Fact Table'[Date])), "Year",YEAR([Date]), "Quarter",ROUNDUP(MONTH([Date])/3,0), "Month",MONTH([Date]), "Day",DAY([Date]) )Create relationships between them. This is key to a functional STAR schema.
pbix file is attached.
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
DC2024
2 years agoFrequent Visitor
Sorry - doesnt seem to have let me attach the file! Here is a sample of the data:
| Date | Product ID | Product Name | Total Product Inventory (Industry) | Store Location | Inventory (Store) | % Inventory Store vs. Industry | Store Inventory Id |
| 13/02/2024 | 7019466 | Bin | 5106000 | Leeds | 1153 | 0.022581 | 6045167 |
| 14/02/2024 | 7019466 | Bin | 5106000 | Leeds | 1153 | 0.022581 | 6045167 |
| 15/02/2024 | 7019466 | Bin | 5106000 | Leeds | 1153 | 0.022581 | 6045167 |
| 16/02/2024 | 7019466 | Bin | 5106000 | Leeds | 1153 | 0.022581 | 6045167 |
| 13/02/2024 | 7000211 | Hoover | 78560000 | London | 18000000 | 22.912423 | 6001065 |
| 14/02/2024 | 7000211 | Hoover | 78560000 | London | 18000000 | 22.912423 | 6001065 |
| 15/02/2024 | 7000211 | Hoover | 78560000 | London | 18000000 | 22.912423 | 6001065 |
| 16/02/2024 | 7000211 | Hoover | 78560000 | London | 18000000 | 22.912423 | 6001065 |
| 16/02/2024 | 7000486 | Duster | 2989454000 | Manchester | 1625186 | 0.054363 | 6001910 |
| 16/02/2024 | 7000486 | Duster | 2989454000 | Southampton | 2036603 | 0.068126 | 6001911 |
| 15/02/2024 | 7000486 | Duster | 2989454000 | Manchester | 1625186 | 0.054363 | 6001910 |
| 15/02/2024 | 7000486 | Duster | 2989454000 | Southampton | 2036603 | 0.068126 | 6001911 |
| 14/02/2024 | 7000486 | Duster | 2989454000 | Manchester | 1625186 | 0.054363 | 6001910 |
| 14/02/2024 | 7000486 | Duster | 2989454000 | Southampton | 2036603 | 0.068126 | 6001911 |
| 13/02/2024 | 7000486 | Duster | 2989454000 | Manchester | 1625186 | 0.054363 | 6001910 |
| 13/02/2024 | 7000486 | Duster | 2989454000 | Southampton | 2036603 | 0.068126 | 6001911 |
| 13/02/2024 | 7011835 | Sponge | 89483000 | Portsmouth | 117989 | 0.131856 | 6412733 |
| 13/02/2024 | 7011835 | Sponge | 89483000 | Brighton | 1000791 | 1.118414 | 6412734 |
| 13/02/2024 | 7011835 | Sponge | 89483000 | Newcastle | 98249 | 0.109796 | 6412735 |
| 13/02/2024 | 7011835 | Sponge | 89483000 | London | 1312844 | 1.467143 | 6412736 |