Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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

1 ACCEPTED SOLUTION

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.

 

View solution in original post

6 REPLIES 6
AlB
Super User
Super User

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
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.

Hi @Anonymous,

 

You could have a good look at this document about how to use Userelationship. 

 

If you still need help, please share some data sample and your desired output so that we could help further on it.

 

For reference, there is a blog Dealing with Inactive Relationships in Power BI which may be helpful to you.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks everyone for your suggestion. It was actually @AlB's suggestion that made somehow made me think to recheck my relationships, and there I found where was my problem. 

Hi @Anonymous,

 

It seems that you have solved your problem.

 

If you have solved, please accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.