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

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.

Reply
Nipius
Advocate I
Advocate I

Calculate if employee matches several requirements

Hi all!

 

I've been cracking my head over this for the past two days, without any luck. Hope you could help me out 🙂

 

Incumbent Employee IDSuccessor Employee IDSuccessor GenderSuccessor ReadinessBalanced (ignoring readiness)Balanced (only looking at Ready Now)
001901FemaleReady NowNoYes
001902FemaleReady NowNoYes
001903MaleReady NowNoYes
001904MaleReady LaterNoYes
001905MaleReady LaterNoYes
002701FemaleReady NowYesYes
002702MaleReady NowYesYes
002703FemaleReady LaterYesYes

 

The idea is that I have a file formatted like in the above table. It has incumbent employee ID's and then shows the gender and readiness of the possible successors. What I'd like to accomplish is to add two columns:

  1. Showing the gender distribution as balanced (50% or above) or not, regardless of the readiness of the successors
  2. Showing the gender distribution as balanced (50% or above) or not , only including the ready now successors.

Hope one of you could help me out. Any help is appreciated 🙂

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

 Hi @Nipius ,

 

We can create two calculated columns to meet your requirement:

 

Balanced (ignoring readiness) = 
VAR t =
    FILTER (
        'Table',
        [Incumbent Employee ID] = EARLIER ( [Incumbent Employee ID] )
    )
RETURN
    IF (
        COUNTROWS ( FILTER ( t, [Successor Gender] = "Female" ) )
            / COUNTROWS ( t ) >= 0.5,
        TRUE (),
        FALSE ()
    )

 

Balanced (only looking at Ready Now) = 
VAR t =
    FILTER (
        'Table',
        [Incumbent Employee ID] = EARLIER ( [Incumbent Employee ID] )
            && [Successor Readiness] = "Ready Now"
    )
RETURN
    IF (
        COUNTROWS ( FILTER ( t, [Successor Gender] = "Female" ) )
            / COUNTROWS ( t ) >= 0.5,
        TRUE (),
        FALSE ()
    )


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-lid-msft
Community Support
Community Support

 Hi @Nipius ,

 

We can create two calculated columns to meet your requirement:

 

Balanced (ignoring readiness) = 
VAR t =
    FILTER (
        'Table',
        [Incumbent Employee ID] = EARLIER ( [Incumbent Employee ID] )
    )
RETURN
    IF (
        COUNTROWS ( FILTER ( t, [Successor Gender] = "Female" ) )
            / COUNTROWS ( t ) >= 0.5,
        TRUE (),
        FALSE ()
    )

 

Balanced (only looking at Ready Now) = 
VAR t =
    FILTER (
        'Table',
        [Incumbent Employee ID] = EARLIER ( [Incumbent Employee ID] )
            && [Successor Readiness] = "Ready Now"
    )
RETURN
    IF (
        COUNTROWS ( FILTER ( t, [Successor Gender] = "Female" ) )
            / COUNTROWS ( t ) >= 0.5,
        TRUE (),
        FALSE ()
    )


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks a ton, @v-lid-msft! Exactly what I was looking for. I'm happy to see I did use the right logic, but I wasn't able to translate this into the right code yet. Really appreciated 🙂

Hi @Nipius ,

 

Have you successfully translated the code in my previous post into the right code you want?


Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.