Forum Discussion

PeterL33's avatar
PeterL33
Regular Visitor
3 years ago

role playing dimensions and USERELATIONSHIP

I am confused on the relationship between role playing dimensions and USERELATIONSHIP. At first I thought using USERELATIONSHIP for an inactive relationship was role playing dimensions but then I found it sounded like you needed a create separate calculated tables for each measure you wanted to use. 

I have read the following articles and posts and I am still unclear:

https://learn.microsoft.com/en-us/power-bi/guidance/star-schema#role-playing-dimensions

https://data-mozart.com/welcome-to-powerbi-thetare-role-playing-dimensions/

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in-power-bi

 

So it sounds like if you have a table with multiple measures you want to use for the relationship, then you create copies of the tables and each will have a different relationship with the single table. Is that it?

3 Replies

  • PeterL33 not fully sure what you are referring here, can you give an example:

     

     I found it sounded like you needed a create separate calculated tables for each measure you wanted to use. 

    • PeterL33's avatar
      PeterL33
      Regular Visitor

      This is what I am interpreting from the articles:
      "If having multiple relationships between two tables is causing the creation of inactive relationship, one way to avoid it seems to be creating multiple instances of the same table, and then you would need only one relationship not more than that."

      "To overcome these limitations, a common Power BI modeling technique is to create a dimension-type table for each role-playing instance. You typically create the additional dimension tables as calculated tables, using DAX. Using calculated tables, the model can contain a Date table, a Ship Date table and a Delivery Date table, each with a single and active relationship to their respective reseller sales table columns."

  • PeterL33 If we look at your example, the challenge with individual tables will be on how to show data on the same x-axis:

     

    for example, if I want to see an order received, shipped, and due by month, I will not have a common dimension to achieve this and will not be able to produce the expected output.  That means I need a common date table with inactive relationships to make it work. In general, it is rare you will have duplicate dimension tables.