Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Where to use Userelationship

Hi All, running into a problem with figuring out where I should be using userelationship in my formula for a calculated column. I'm trying to use an inactive relationship I have with my date table and my date recieved column. Below is what I'm using now which returns from another table my date recieved. Any help would be appreciated. 

 

 

=CALCULATE (   FIRSTNONBLANK ( Receiving Table[Date Received], 1 ),     FILTER ( ALL ( Receiving Table ), Receiving Table[Item Number] = 'PO Table'[Item Number]  && Receiving Table[PO Number] = 'PO Table'[PO Number])

 

Thanks

Kevin

  • AlB's avatar
    AlB
    7 years ago

    ok  Anonymous

    so update the arguments of USERELATIONSHIP with the columns involved on the inactive relationship you want to activate. which ones are they? I don't have the data model.

     

6 Replies

  • AlB's avatar
    AlB
    Community Champion

    Hi Anonymous

    You can use the USERELATIONSHIP within the CALCULATE, something like shown below. Although I am not sure this is exactly what you are after??

     

     

    CALCULATE (
        FIRSTNONBLANK ( 'Receiving Table'[Date Received], 1 ),
        FILTER (
            ALL ( 'Receiving Table' ),
            'Receiving Table'[Item Number] = 'PO Table'[Item Number]
                && 'Receiving Table'[PO Number] = 'PO Table'[PO Number]
        )
        USERELATIONSHIP('Receiving Table'[Date Received], 'Date'[Date])
    )

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for your quick reply AlB. Your suggestion was what first came to mind, and as a result I recieve the following error:

       

      USERELATIONSHIP function can only use the two columns references participating in relationship.

      • AlB's avatar
        AlB
        Community Champion

        ok  Anonymous

        so update the arguments of USERELATIONSHIP with the columns involved on the inactive relationship you want to activate. which ones are they? I don't have the data model.