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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
apeeltyler
Frequent Visitor

Need help adding to my Measure to count Voluntary/Involuntary Terms

I need some help adding in a column to count Voluntary & Involuntary Terminations to the following code.  I will use this as my lookup to determine who is Voluntary/Involuntary.  I'm not sure where I should add it:

Roster[Vol/Invol]

 

Term EEs Vol/Invol = 
IF (
    CALCULATE (
        COUNT ( Roster[Employee Id] ), 
        USERELATIONSHIP ( Roster[Termination Date], 'Calendar'[Date] ),
        NOT ( ISBLANK ( Roster[Termination Date] ) )
    ) = 0,
    0,
    CALCULATE (
        COUNT ( Roster[Employee Id] ),
        USERELATIONSHIP ( Roster[Termination Date], 'Calendar'[Date] ),
        NOT ( ISBLANK ( Roster[Termination Date] ) )
    )
)

 

 

1 ACCEPTED SOLUTION

Hey @Anonymous .  Thanks for replying.  I was able to work with a coworker and we came up with this, using 

NOT CONTAINSSTRING([Vol/Invol], "Involuntary") &&

  So it ended up with this:  (one for Voluntary and one for Involuntary)

 

Termed EEs Voluntary = 
IF (
    CALCULATE (
        COUNTROWS (
            FILTER (
                Roster,
                NOT CONTAINSSTRING([Vol/Invol], "Involuntary") &&
                NOT ( ISBLANK ( Roster[Termination Date] ) )
            )
        ),
        USERELATIONSHIP ( Roster[Termination Date], 'Calendar'[Date] )
    ) = 0,
    0,
    CALCULATE (
        COUNTROWS (
            FILTER (
                Roster,
                NOT CONTAINSSTRING([Vol/Invol], "Involuntary") &&
                NOT ( ISBLANK ( Roster[Termination Date] ) )
            )
        ),
        USERELATIONSHIP ( Roster[Termination Date], 'Calendar'[Date] )
    )
)

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @apeeltyler 

You can set it as a paramater

e.g 

Term EEs Vol/Invol =
VAR a =
    IF (
        CALCULATE (
            COUNT ( Roster[Employee Id] ),
            USERELATIONSHIP ( Roster[Termination Date], 'Calendar'[Date] ),
            NOT ( ISBLANK ( Roster[Termination Date] ) )
        ) = 0,
        0,
        CALCULATE (
            COUNT ( Roster[Employee Id] ),
            USERELATIONSHIP ( Roster[Termination Date], 'Calendar'[Date] ),
            NOT ( ISBLANK ( Roster[Termination Date] ) )
        )
    )
RETURN
    IF ( a <> 0, [Roster], 0 )

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey @Anonymous .  Thanks for replying.  I was able to work with a coworker and we came up with this, using 

NOT CONTAINSSTRING([Vol/Invol], "Involuntary") &&

  So it ended up with this:  (one for Voluntary and one for Involuntary)

 

Termed EEs Voluntary = 
IF (
    CALCULATE (
        COUNTROWS (
            FILTER (
                Roster,
                NOT CONTAINSSTRING([Vol/Invol], "Involuntary") &&
                NOT ( ISBLANK ( Roster[Termination Date] ) )
            )
        ),
        USERELATIONSHIP ( Roster[Termination Date], 'Calendar'[Date] )
    ) = 0,
    0,
    CALCULATE (
        COUNTROWS (
            FILTER (
                Roster,
                NOT CONTAINSSTRING([Vol/Invol], "Involuntary") &&
                NOT ( ISBLANK ( Roster[Termination Date] ) )
            )
        ),
        USERELATIONSHIP ( Roster[Termination Date], 'Calendar'[Date] )
    )
)
apeeltyler
Frequent Visitor

Forgot to add Roster[Vol/Invol] will either be "Voluntary" or "Involuntary".  I'm just not sure where to add this to my DAX Measure

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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 Solution Authors