Forum Discussion
Designing a Business Intelligence Solution for Pharmaceutical Sales Tracking and Commission Calculat
- 8 months ago
Fact tables:
- Things that are recorded like actual sales and budget, this can then contain foreign keys to your dimension tablesDimension tables:
- Think of this as the best way to trim down your fact tables, for example could Distribution Channels be one (or multiple) fact tablesMeasures
- Generally if raw data contains calculated fields that you could recalculate given other fields, it's safer to do them as measures. I.e. % is usually a flag that it should be a field so it can be calculated dynamically assuming you have the fields that make up the numerator and denominator.I pushed this through AI and refined it a little to give you a starting point (though generally I would suggest Measures should be in their own table.
Fact Tables:
FactSales
- Measures:
- SalesAmount (actual revenue)
- QuantitySold
- CommissionAmount
- Foreign Keys:
- DateKey
- ProductKey
- BusinessUnitKey
- MedicalRepKey
- DistributionChannelKey
- CustomerKey
- SalesTypeKey (Primary/Secondary/Wholesale)
- Measures:
FactBudget
- Measures:
- BudgetAmount
- Foreign Keys:
- DateKey
- ProductKey
- BusinessUnitKey
- MedicalRepKey (nullable)
- DistributionChannelKey (nullable)
- CustomerKey (nullable)
- Measures:
Dimension Tables:
DimDate
- DateKey (PK)
- FullDate
- Day
- Month
- MonthName
- Quarter
- Year
- IsWeekend
- FiscalPeriod
DimProduct
- ProductKey (PK)
- ProductID
- ProductName
- TherapeuticCategory
- Formulation
- Strength
- PackageSize
- IsActive
DimBusinessUnit
- BusinessUnitKey (PK)
- BusinessUnitID
- BusinessUnitName
- Region
- Manager
DimMedicalRepresentative
- MedicalRepKey (PK)
- EmployeeID
- FullName
- HireDate
- Territory
- CommissionRate
- ManagerID
DimDistributionChannel
- DistributionChannelKey (PK)
- ChannelID
- ChannelName (Pharmacy/Hospital/Export etc.)
- ChannelCategory
DimCustomer
- CustomerKey (PK)
- CustomerID
- CustomerName
- CustomerType
- Location
- CreditRating
DimSalesType
- SalesTypeKey (PK)
- TypeName (Primary/Secondary/Wholesale)
- CommissionRules
- 8 months ago
Hi Yakout ,
answer is yes to both questions.
Best
FB
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Hi ,- dimensions:
Product
Business Unit
Medical Representative
Distribution Channel
Customer
Date
- other tables are fact tables to connect many to 1 to the dimensions
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Hi FBergamaschi ,
Thank you so much for your response. I would like to ask whether Budget, Actual Sales, and Commission should be modeled as fact tables, and if it is possible to have three fact tables in a star schema ?
- FBergamaschi8 months ago
Super User
Hi Yakout ,
answer is yes to both questions.
Best
FB
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI