Forum Discussion

Quafe's avatar
Quafe
Regular Visitor
9 years ago
Solved

Date dimension and multiple date columns in fact table

Straight to the point: how does one deal with multiple columns containing date values in the master fact table, and a separate date dimension? The way our data warehouse tables are structured, a s...
  • Phil_Seamark's avatar
    9 years ago

    You can have multiple relationships between your Fact table and your Date Dimension table.

     

    So a FACT table with [Order Date] , [Ship Date] and [Delivery Date] can all be related to your Date dimension.

     

    Only one relationship can be Active!  You should set this to be the most common link.

     

    Then you create measures per date action and use the DAX function called USERELATIONSHIP 

     

    https://msdn.microsoft.com/en-us/library/hh230952.aspx

     

    So a measure counting the number of deliveries will specify that the Inactive relationship is to be used for that particular calculation.

     

    A bit of a pain but it's not as bad as it sounds.

     

    Otherwise use an MDX cube and you will have no such issues :)