Forum Discussion

blockobito's avatar
blockobito
Icon for Helper I rankHelper I
3 years ago
Solved

How to count Average of Text?

Hi i have a data column Gender  I need to count Male and Female and the average percentage will be 50%     
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi blockobito ,

     

    If you want to calculate the percentage of males and females in the total, you can try this code.

    Percentage = 
    VAR _Total =
        CALCULATE ( COUNT ( 'Table'[User] ), ALL ( 'Table' ) )
    VAR _Each_Gender =
        CALCULATE ( COUNT ( 'Table'[User] ) )
    RETURN
        DIVIDE ( _Each_Gender, _Total )

    My Sample:

    Result is as below.

     


    Best Regards,
    Rico Zhou

     

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