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.
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...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
97 | |
82 | |
74 | |
66 |
User | Count |
---|---|
120 | |
105 | |
99 | |
81 | |
72 |