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
DC2024
Frequent 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 anything needs clarifying.

 

I have received a sample dataset from our Product team, attached (I've anonymised it as I can't share the original file). Basically it is a time series showing the inventory held for a number of household products held in each store. Each row is a single day's worth of data per store and product. Also on each row is the total inventory across the industry on that day for that product.

 

I've tried using something like the STAR method for constructing the data model (separating out the Dimensional data from the Fact data), but the visuals actually seemed to work better when I just left all the data in a single source and created charts / graphs over that single source.

 

I guess I just wanted to see how others (far more experienced than me!) would structure this in Power Query / use this data in Power BI to create better visuals, especially given the time series nature of the data. Sorry if this is a bit vague, am still very new to Power BI !

 

Thanks
DC

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @DC2024 ,

 

You can create a separate dimension table for stores, products and date.

 

For example:

 

Fact Table:

vhuijieymsft_0-1713146535604.png

 

Product dimension table:

vhuijieymsft_1-1713146535605.png

 

Store dimension table:

vhuijieymsft_2-1713146562661.png

 

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])
)

vhuijieymsft_3-1713146562662.png

 

Create relationships between them. This is key to a functional STAR schema. 

vhuijieymsft_4-1713146607752.png

 

pbix file is attached.

 

If you have any further questions please feel free to contact me.

 

Best Regards,
Yang
Community Support Team

 

If 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!

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @DC2024 ,

 

You can create a separate dimension table for stores, products and date.

 

For example:

 

Fact Table:

vhuijieymsft_0-1713146535604.png

 

Product dimension table:

vhuijieymsft_1-1713146535605.png

 

Store dimension table:

vhuijieymsft_2-1713146562661.png

 

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])
)

vhuijieymsft_3-1713146562662.png

 

Create relationships between them. This is key to a functional STAR schema. 

vhuijieymsft_4-1713146607752.png

 

pbix file is attached.

 

If you have any further questions please feel free to contact me.

 

Best Regards,
Yang
Community Support Team

 

If 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!

That is fantastic, thank you very much Yang!

DC2024
Frequent Visitor

Sorry - doesnt seem to have let me attach the file! Here is a sample of the data:

DateProduct IDProduct NameTotal Product Inventory (Industry)Store LocationInventory (Store)% Inventory Store vs. IndustryStore Inventory Id
13/02/20247019466Bin5106000Leeds11530.0225816045167
14/02/20247019466Bin5106000Leeds11530.0225816045167
15/02/20247019466Bin5106000Leeds11530.0225816045167
16/02/20247019466Bin5106000Leeds11530.0225816045167
13/02/20247000211Hoover78560000London1800000022.9124236001065
14/02/20247000211Hoover78560000London1800000022.9124236001065
15/02/20247000211Hoover78560000London1800000022.9124236001065
16/02/20247000211Hoover78560000London1800000022.9124236001065
16/02/20247000486Duster2989454000Manchester16251860.0543636001910
16/02/20247000486Duster2989454000Southampton20366030.0681266001911
15/02/20247000486Duster2989454000Manchester16251860.0543636001910
15/02/20247000486Duster2989454000Southampton20366030.0681266001911
14/02/20247000486Duster2989454000Manchester16251860.0543636001910
14/02/20247000486Duster2989454000Southampton20366030.0681266001911
13/02/20247000486Duster2989454000Manchester16251860.0543636001910
13/02/20247000486Duster2989454000Southampton20366030.0681266001911
13/02/20247011835Sponge89483000Portsmouth1179890.1318566412733
13/02/20247011835Sponge89483000Brighton10007911.1184146412734
13/02/20247011835Sponge89483000Newcastle982490.1097966412735
13/02/20247011835Sponge89483000London13128441.4671436412736

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.