Forum Discussion

ibrewop23's avatar
ibrewop23
Frequent Visitor
3 years ago

USERELATIONSHIP usage: One active and one inactive relationship in calculate measure

Hi - I am looking to understand if I need to be using 'USERELATIONSHIP' in my measure and if not, why not?

 

I am calcualting headcount as at the end of each calendar month. Here is my model:

Active relationship: Leave Date and Date

Inactive relationship: Start Date and Date

 

Here is my measure:

 

Headcount End of Month = 
CALCULATE (
    DISTINCTCOUNT( 'Headcount'[Employee Code] ),
    'Headcount'[Start Date] <= MAX ( 'Date Table'[End of Month] )
        && (
            Headcount[Leave Date] > MAX ( 'Date Table'[End of Month] )
                || ISBLANK ( Headcount[Leave Date] )
        )
)

 If both relationships are inactive, I am aware that I do not need USERELATIONSHIP.

2 Replies