As a part of designing an Analysis Services cube you must define how each dimension is related to each measure group in your cube through the Dimension Usage tab. The Dimension Usage tab is found when editing the cube in the cube designer. The screenshot below shows dimensions on rows and measure groups on columns. The points at which they intersect define how they are related. These relationships are automatically defined when the two objects (measure groups and dimensions) are added to the cube but to manually change the relationships click the ellipses intersecting relationship boxes.
The first type of relationship option you should know about really is not a relationship at all. This type is called No Relationship as shown in the image below. Anywhere you find this relationship type it will appear as the greyed out box at the intersecting points on the Dimension Usage tab. This relationship type would be used when a dimension has no relationship to a measure group. For example, if you have a measure group that holds nothing but sales that occur on the internet and a dimension that has employee data then you are likely going to use the No Relationship type. Sales that transpire on the internet likely have no employee associated with them so in this case it makes sense that the cube has no relationship defined.
Keep in mind that having no relationship can cause confusion to end users if they try to browse two unrelated objects. That’s why it is important to properly train users how to browse the cube. The measure group property IgnoreUnrelatedDimensions can also help end users from getting confused when browsing unrelated cube objects.
The Regular relationship type is the most traditional relationships that exist in data warehouses. Think of this as a typical one-to-many relationship. For example, a product dimension is full of a unique list of products but the fact table that it relates to has many instances of that product for each time it is sold. In a traditional data warehouse design the product dimension has a unique key that represents each distinct instance of a product, while the fact table may store that product key several times for each transaction that sold the same product. In this case the product key is a primary key in the product dimension and a foreign key in the fact table.
The screenshot below shows the FactInternetSales measure group related to the DimCustomer dimension using the CustomerKey. The diagram in the image depicts the relationship with the yellow table as the fact table and the blue table as the dimension table.
The Fact relationship type is used when a measure group is also used as a dimension. Sounds a little confusing right? Sometimes there are business cases when you not only want to aggregate data that is in a measure group but you also want to slice by values in it as well. When this is a requirement you create the measure group and dimensions separately and then relate them in the Dimension Usage tab with a Fact relationship. This type of relationship is also known as a degenerate dimension.
An example when you may use this relationship type is with a measure group that stores sales orders. In this case not only do you want to aggregate sales order data but you also want to slice by Order Numbers in the same table.
Referenced relationship types are often used when your data warehouse design utilizes a snowflake schema design. Without getting into a lengthy data warehouse design discussion snowflake design is different from a star schema design because a snowflake design is a more normalized view of the data with dimensions that “branch” off of each other. A star schema is a more denormalized view of the data with dimensions all directly relating to the fact table.
Imagine you run a data warehouse for a movie store (yes I realize movie stores are pretty much extinct). The fact table (measure group) holds sales that occur in the store and a dimension will all the movies that could possibly be sold. There is another dimension with the movie genre that is related to the movie dimension instead of the fact table. If I want to have an independent dimension in my cube for genre then I must use a Referenced relationship type to relate it to the appropriate measure groups. There is no direct relationship between genre and the fact table which is where the “referenced” part of this relationship becomes relevant. The cube “hops” through the movie dimension to simulate a direct relationship between genre and the fact table. The dotted line in the diagram on the below images represents this. Referenced dimensions are not optimal for performance and if you can optionally avoid them you should do so.
Using a Many-to-Many relationship is done when a data warehouse design implements a bridge table between dimensions to appropriately represent all combinations of data. For example, a dating website has members and members have hobbies. A member can have many hobbies and a hobby can be associated with multiple members. To accomplish this in a data warehouse design a bridge table can be used to relate each combination of hobby and member. This bridge table is often called a factless fact table because when it is brought into the cube it is necessary to define it as a measure group.
When defining this relationship in the cube you the factless fact table is the intermediate dimension that is used to relate the two dimensions to the measure group.
The rarely used Data Mining relationship relates a mining model that was created from a cube dimension to the appropriate measure group.
If you have any other questions about data warehouse design or cube creation feel free to email me at firstname.lastname@example.org