Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

UseRelationShip with no calculations

Hello

this is my model:

I need to get one field from table A and show the related fields in tables B and C use the inactive relationship between them.

for example, i need the 
A.project_name B.Request_Number C.Reference_Bil
can I do it without changing the relationships?

I tried to do it with calculate max and userelationship but i need to get all the related values and not only the max/min.

  • I know, this is what the measure allows if you use the measure in combination with columns from two different tables connected by an inactive relationship:

    Maybe this makes it clearer.
    Just select the columns from the different tables.
    But maybe I did not understand what you are looking for.

     

    Regards,

    Tom

4 Replies

  • Hey Anonymous ,

     

    basically it's not possible to activate an inactive relationship without a calculation. The reason for this is -  USERELATIONSHIP is considered being a filter modifier function. This means you need CALCULATE or CALCULATETABLE to use USERELATIONSHIP.

     

    Assuming I have two tables connected by an inactive relationship I create a measure like this:

    Check Relationship Product / ProductSubcategory = 
    CALCULATE(
        COUNT( 'DimProduct'[ProductName] )
        , USERELATIONSHIP( 'DimProductSubcategory'[ProductSubcategoryKey]  , 'DimProduct'[ProductSubcategoryKey] )
    )

    The implicit NULL filter in a table or matrix visual provides the expected result.
    Because there are three tables involved you might also use some visual level filtering.

     

    Hopefully, this provides some ideas on how to tackle your challenge.

     

    Regards,

    Tom

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you, but its not what i mean..

    i need it to return the value and not the count of the values.

    • TomMartens's avatar
      TomMartens
      Icon for Super User rankSuper User

      I know, this is what the measure allows if you use the measure in combination with columns from two different tables connected by an inactive relationship:

      Maybe this makes it clearer.
      Just select the columns from the different tables.
      But maybe I did not understand what you are looking for.

       

      Regards,

      Tom

      • Anonymous's avatar
        Anonymous
        Not applicable

        It works, Thank you very much.