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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
ErMley
Frequent Visitor

What If Parameters for Gender Balance in Company?

Hi all, 

 

Looking for some support in ideating a solution to this problem. I have demographic data to work with which shows the following fields:

1. Employee ID

2. Gender (options: Male, Female, Other [Non-Binary and Self-Identifying])

3. Hire Date

4. Termination Date

 

I would like to use a what-if parameter similar to this video: https://www.youtube.com/watch?v=QXNRseW0R7E which would allow a dashboard user to view the following DAX measures and parameters:

1. Current Number of Females and % of Population (I have these DAX Measures already)

2. A what-if parameter for 'Target Population' of women as a percentage (e.g. 30% of population to be women)

3. A what-if parameter for 'Target Year' which would allow the user to select the year at which the target population would be achieved

4. A line chart showing the growth/recruitment needed for women to meet that target 

 

Ideally, I would also like to have a what-if parameter for the male and 'other' populations to take into account population growth rates in other areas which may impact the total population proportion of women but I cannot seem to get this to work esp. in a line chart format. Does anyone have any ideas on approaches to resolve this? 

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

Hi @ErMley 

 

Since I don't know what your data looks like, I tested it using simple data and here is my solution, hope it helps.
If this doesn't work for you, please share some sample data and explain it so we can understand your problem better.

 

My test data like this:

vxianjtanmsft_0-1730183851119.png

Create a calendar table with the following DAX:

DateTable = 
ADDCOLUMNS(
    CALENDAR(DATE(2020,1,1), DATE(2025,12,31)),
    "Year", YEAR([Date])
)

Select New Parameter in the Modeling tab:

vxianjtanmsft_1-1730184411930.png

Create the following measures:

TotalPopulation = 
CALCULATE(
    COUNTROWS('Table'), 
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Hire Date] <= MAX('DateTable'[Date]) &&
        (ISBLANK('Table'[Termination Date]) || 'Table'[Termination Date] > MAX('DateTable'[Date]))
    )
)
FemalePopulation = 
CALCULATE(
    COUNTROWS('Table'), 
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Gender] = "Female" &&
        'Table'[Hire Date] <= MAX('DateTable'[Date]) &&
        (ISBLANK('Table'[Termination Date]) || 'Table'[Termination Date] > MAX('DateTable'[Date]))
    )
)
FemaleTargetPopulation = [TotalPopulation] * 'Female Target Percentage'[Female Target Percentage Value]  / 100
FemaleNeedIncreased = [FemaleTargetPopulation] - [FemalePopulation]

 

Repeat the above to create parameters and measures for Male and Other.

 

Create a Line Chart with the Calendar table “Year” field as the X-axis and the measures of the number of people to be increased as the Y-axis:

vxianjtanmsft_2-1730184525079.png

 

 

Best Regards,
Jarvis Tang
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

2 REPLIES 2
v-xianjtan-msft
Community Support
Community Support

Hi @ErMley 

 

Since I don't know what your data looks like, I tested it using simple data and here is my solution, hope it helps.
If this doesn't work for you, please share some sample data and explain it so we can understand your problem better.

 

My test data like this:

vxianjtanmsft_0-1730183851119.png

Create a calendar table with the following DAX:

DateTable = 
ADDCOLUMNS(
    CALENDAR(DATE(2020,1,1), DATE(2025,12,31)),
    "Year", YEAR([Date])
)

Select New Parameter in the Modeling tab:

vxianjtanmsft_1-1730184411930.png

Create the following measures:

TotalPopulation = 
CALCULATE(
    COUNTROWS('Table'), 
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Hire Date] <= MAX('DateTable'[Date]) &&
        (ISBLANK('Table'[Termination Date]) || 'Table'[Termination Date] > MAX('DateTable'[Date]))
    )
)
FemalePopulation = 
CALCULATE(
    COUNTROWS('Table'), 
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Gender] = "Female" &&
        'Table'[Hire Date] <= MAX('DateTable'[Date]) &&
        (ISBLANK('Table'[Termination Date]) || 'Table'[Termination Date] > MAX('DateTable'[Date]))
    )
)
FemaleTargetPopulation = [TotalPopulation] * 'Female Target Percentage'[Female Target Percentage Value]  / 100
FemaleNeedIncreased = [FemaleTargetPopulation] - [FemalePopulation]

 

Repeat the above to create parameters and measures for Male and Other.

 

Create a Line Chart with the Calendar table “Year” field as the X-axis and the measures of the number of people to be increased as the Y-axis:

vxianjtanmsft_2-1730184525079.png

 

 

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

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information. Do not include anything that is unrelated to the issue or question.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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