Forum Discussion
Data Model Retail Business (help!!)
Hi Guys,
I work on the retail business (several stores and several products) and i would like to make a report about:
1) Products with NO SALES
2) Products with stock coverage:
Products with > 50 days of stock
Producst with 20 to 50 days of stock
Products with < 20 days of stock
On my datal model i have:
Fact tables:
Stock table (data granularity - month)
Sales table (data granularity - month)
Dimension tables:
Data
Produt
Assumptions:
Stock coverage = Stock of product x at the store A dividing by Sales of the product x at the Store A
Stock with no sales = Product who make part of the products table but doesnt have any record of sales on the same month.
So acording with this assumptions im dealing with a big problem (at least for me obviouslly...). To calculate the "Stock coverage" its necessary to make calculations on rows (X Functions), but i have no chance to make them between diferent fact tables (stocks and sales). So how is the best way to do it?
Thank you so much!
13 Replies
- amitchandakSuper User
Anonymous ,Can you share sample data and sample output in table format?
for no sales you can try like
if( isblank(CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))) && CALCULATE(SUM(Item[Qty]),DATESMTD('Date'[Date])) >0, "Stock with no sales",blank())
- AnonymousNot applicable
amitchandak thank your the quick answer.
Please find bellow the sample of the data model.
https://drive.google.com/file/d/1PzNI0i4pL094meB_0eg7wwRxm52K1jy9/view?usp=sharing
Please be welcome to put the measures inside on it. No worries.
Thanks in advance again.
- richbenmintzResident Rockstar
Hi Anonymous,
Can you provide a table with your expected values, I am trying to understand why you need an 'X' function seems like a straight divide to me.
Thanks,