Forum Discussion

rush's avatar
rush
Icon for Helper V rankHelper V
9 years ago
Solved

How create a measure that counts a value in one column then divides by another

Hi All   I would like to create a measure that will count a value in one column then divides by another.   I have tried to create the measure for Male & Female but it does not bring back the resu...
  • anupampandey's avatar
    anupampandey
    9 years ago

    Hi rush,

     

    Yes you can put the filter while summarizing the table. Use below syntax:

     

    Race %Age = CALCULATETABLE(SUMMARIZE(Staff,Staff[Race],"TotalStaff",SUM(Staff[Staff Count]),"Male",CALCULATE(SUM(Staff[Staff Count]),FILTER(Staff,Staff[Gender]="Male")),"Female",CALCULATE(SUM(Staff[Staff Count]),FILTER(Staff,Staff[Gender]="Female"))),FILTER(Staff,Staff[Team Member Status]="Active")

     

    I hope this will work for you to get the desired result. If it works please accept it as a solution.

     

    Thanks & Cheers!!!

    Anupam