The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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:
Relationships (one-to-many):
Formula when one-to-many (correct result):
Relationships (one-to-one):
Formula when one-to-one (incorrect result):
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
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
Proud to be a Super User!
Check out my blog: Power BI em Português@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.
@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.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
111 | |
80 | |
78 | |
43 | |
37 |
User | Count |
---|---|
157 | |
112 | |
64 | |
60 | |
54 |