Forum Discussion

Rapports's avatar
Rapports
Helper I
2 years ago

Calculate a rate

Hello community, 

 

Please help me to solve this question: I have this database 

How I can calculate the A rate on the total A+P for the given student knowung that this operation must be done for the other students.  

Thank you 

4 Replies

  • Rapports ,  Create measure like

     

    Divide( calculate(Sum(Table[Attend]), filter(Table, Table[Status Absence] = "A") ), calculate(Sum(Table[Attend]), filter(Table, Table[Status Absence] in{ "A", "P"} ) ))

     

     

    or

     

     

    Divide( calculate(Sum(Table[Attend]), filter(Table, Table[Status Absence] = "A") ), calculate(Sum(Table[Attend]), filter(all(Table[Status Absence]), Table[Status Absence] in{ "A", "P"} ) ))

    • Rapports's avatar
      Rapports
      Helper I

      I can't share a sample but the output i need is to calculate the rate of absence "A" in the total. like the picture below