Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Problem with total percentages

Hi experts,

 

I am trying to get from all the users, the percentage of Males and Females, ignoring the blank() values:

 

 

 

Pc M_F = 
DIVIDE (
        [Number of users no blank];
        CALCULATE (
            [Number of users no blank];
            FILTER(DimFan;DimFan[Gender Label] <> BLANK() && DimFan[Gender Label] <> "NS/NC"  )
        ); 0
)

From the table, It should be, for Male = 88%  (374/421)  and for Female = 11.1% .  421 is the sum only of male and female users.

 

Any thoughs

 

7 Replies

  • Anonymous try following measures:

     

    Number of uses not blank = 
    CALCULATE( 
        SUM( 'Table'[Users] ),
        KEEPFILTERS( 'Table'[Gender Label] IN { "Female", "Male" } )
       
    ) 
    
    Total Number of Users = 
    CALCULATE( [Number of uses not blank], ALL( 'Table'[Gender Label] ) )
    
    % = DIVIDE(  [Number of uses not blank], [Total Number of Users] )
    
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi parry2k  I've tried what you did, but with no success. I did it, with other data. This is what I have:

       

       

      In this example, for 35-39 it should be 42% and so on. I can not get the "Total" (7), to divide into each "Numb of usersbin"

       

      Numb of usersbin = CALCULATE ( 
              [Users Registered]; 
             KEEPFILTERS( DimFan[AgeRange Label] IN {"<10";">=65";"10-14";"15-19";"20-24";"25-29";"30-34";"35-39";"40-44";"45-49";"50-54";"55-59";"60-64"} )
      )
      
      %Usrs AgeBin = DIVIDE(  [Numb of usersbin]; [Users Registered])
      • parry2k's avatar
        parry2k
        Super User

        Anonymous what is the measure for [User Registered] if you are going to check such a big range we could have done it differently. Can you drop it in the table and see what value you are getting?