Forum Discussion

ch_01's avatar
ch_01
New Member
3 years ago
Solved

Percentage formula

Hi, 

 

I need to calculate percentage promoted people according to Gender from total employees, 
( Columns: Total Employees, Gender, Hire (1/0 as values), Hire percentage) when I try to calculate percentage for Hire its giving me 100% as results for both genders. 

 

 I'm pretty new to Power BI so looking for some help.

 

  • Hi, ch_01 

     

    You can try the following methods.
    Measure:

    Percentage = 
    Var _N1=CALCULATE(COUNT('Table'[Gender]),FILTER(ALL('Table'),
                            [Gender]=SELECTEDVALUE('Table'[Gender])&&[Promotion 2021]=1))
    Var _N2=CALCULATE(COUNT('Table'[Gender]),ALL('Table'))
    Return
    DIVIDE(_N1,_N2)

    Please check the attachment, I hope it can help you.

     

    Best Regards,

    Community Support Team _Charlotte

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

     

2 Replies

  • v-zhangti's avatar
    v-zhangti
    Community Support

    Hi, ch_01 

     

    You can try the following methods.
    Measure:

    Percentage = 
    Var _N1=CALCULATE(COUNT('Table'[Gender]),FILTER(ALL('Table'),
                            [Gender]=SELECTEDVALUE('Table'[Gender])&&[Promotion 2021]=1))
    Var _N2=CALCULATE(COUNT('Table'[Gender]),ALL('Table'))
    Return
    DIVIDE(_N1,_N2)

    Please check the attachment, I hope it can help you.

     

    Best Regards,

    Community Support Team _Charlotte

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