How to Model Date Dimensions with Fact Tables of Different Grains

Viewed 399

We have some use cases for our DW where we have fact tables at different grains - e.g., sales by store by day (fact 1) and sales budget targets by month (fact 2). They both involve Date as a grain, but in one case the grain is day and the other the grain is period.

Assuming we can't in the near term change the grain, what's the right way to model this?

A Date and a Month dimension, which will have conformed attributes? 1 Date dimension, with nulls or flags or something when it's representing a higher value (e.g., month) Something else?

2 Answers

You only need one date dimension with one row per day. Just link to the last day of your period. E.g. for a monthly aggregated fact just link to the last day of the month in your date dimension.

Two different dimensions, one for Date and one for Month

Related