The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I'm getting an error message the following error message "USERELATIONSHIP function can only be used in the CALCULATE" with the below measure I have written and I'm not sure where I have gone wrong, but I'm definately using CALCULATE and USERELATIONSHIP.
Leavers VOL = CALCULATE(COUNT(Person[PersonID]),
USERELATIONSHIP(Dates[Date], Person[TerminationDate])+0,
FILTER(Person,Person[TerminationReason] IN{"Resignation - VOL","Retirement - VOL"}))
Assistance is much appreciated
Solved! Go to Solution.
Hi @Anonymous
You may try it this way
Leavers VOL =
CALCULATE (
COUNT ( Person[PersonID] ),
USERELATIONSHIP ( Dates[Date], Person[TerminationDate] ),
FILTER (
Person,
Person[TerminationReason] IN { "Resignation - VOL", "Retirement - VOL" }
)
) + 0
Hi @Anonymous
You may try it this way
Leavers VOL =
CALCULATE (
COUNT ( Person[PersonID] ),
USERELATIONSHIP ( Dates[Date], Person[TerminationDate] ),
FILTER (
Person,
Person[TerminationReason] IN { "Resignation - VOL", "Retirement - VOL" }
)
) + 0