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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

CALCULATE and USERRELATIONSHIP not working

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

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@tamerj1 

 

Works perfectly thank you.

tamerj1
Super User
Super User

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors