Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi, I have inactive relationships set up between 'MyReport' and 'LegendCategories' table; however, I am still seeing the error 'USERELATIONSHIP function can only use the two columns references participating in relationship' in this code:
Varible =
SWITCH(
TRUE(),
---------GENDER---------
SELECTEDVALUE(LegendCategories[Field]) = "Gender",
CALCULATE(
[CountPersons], #custom measure to count the number of names in a column
USERELATIONSHIP('MyReport'[Gender], LegendCategories[Category])
),
---------Race---------
SELECTEDVALUE(LegendCategories[Field]) = "Race",
CALCULATE(
[CountPersons], #custom measure to count the number of names in a column
USERELATIONSHIP('MyReport'[Race], LegendCategories[Category])
),
BLANK()
)
I rechecked the relationships, confirmed the spellings, interchanged the syntax of USERELATIONHIP such that 'many' table comes before the 'one' table (as I have 'Many to 1' relationship set here). Nothing seems to be working! Any advice?
Thanks so much!
@shefali_13 , hope you have created an inactive/active relationship between USERELATIONSHIP('MyReport'[Race], LegendCategories[Category]) or USERELATIONSHIP('MyReport'[Gender], LegendCategories[Category])
if the relationship is missing, then you get an error like above
example
Power BI: HR Analytics - Employees as on Date : https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
80 | |
60 | |
35 | |
35 |
User | Count |
---|---|
100 | |
62 | |
56 | |
47 | |
41 |