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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Zyg_D
Continued Contributor
Continued Contributor

USERELATIONSHIP does not work on one-to-one

The function USERELATIONSHIP nicely works when the top right relationship is one-to-many. But when I change it to one-to-one, the USERELATIONSHIP does not yield correct results. Why? It should not be affected at all, in my opinion. 

Data:

Tables.JPG

Relationships (one-to-many):

relationships-works.JPG

Formula when one-to-many (correct result):

formula-one-to-many.JPG

Relationships (one-to-one):

relationships-no-work.JPG

Formula when one-to-one (incorrect result):

formula-one-to-one.JPG

 

4 REPLIES 4
Anonymous
Not applicable

Hi @Zyg_D ,

Please review the following documentations and check if they can help you.

Create and manage the relationship

The Cardinality of Power BI Relationship Demystified

One-To-One Relationships In Power BI

Best Regards

Rena

MFelix
Super User
Super User

Hi @Zyg_D ,

 

This is related with the way that the USERELATIONSHIP works, the function is used as a context transaction and the calculated columns force this to be a row context so the calculation will give inacturated values.

 

Check the blog post of SQL BI with a full detail on this, and that suggest in this case the use of LOOKUPVALUE or the use of CALCULATETABLE depending on expected results.

 

https://www.sqlbi.com/articles/userelationship-in-calculated-columns/


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





parry2k
Super User
Super User

@Zyg_D first and foremost question, since this relationship is active, not sure why you are using USERELATIONSHIP, and 2nd you don't need to use MAX function, you can simply use RELATED function to get value from One side of the relatioship.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Zyg_D
Continued Contributor
Continued Contributor


@parry2k wrote:

@Zyg_D first and foremost question, since this relationship is active, not sure why you are using USERELATIONSHIP, and 2nd you don't need to use MAX function, you can simply use RELATED function to get value from One side of the relatioship.

In the USERELATIONSHIP I am trying to use the bottom right relationship. However, I see that the top right one affects my results, which is bizzare.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.