Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Group by calculation

Please help me to findout the 'status' calculated column. I have attached data sample with calculation:  I tried: 1st Calculated column:(DR_Stud) VAR CC=FactStudentRecord[InSession] RETURN ...
  • v-danhe-msft's avatar
    7 years ago

    Hi Anonymous,

    Based on my test, you could refer to below formula:

    Schoolperform = ROUND(
                    DIVIDE(CALCULATE(COUNT(FactStudentRecord[SchoolId]),FILTER('FactStudentRecord','FactStudentRecord'[Insession]>=7&&'FactStudentRecord'[SchoolId]=EARLIER(FactStudentRecord[SchoolId]))),
                    CALCULATE(COUNT(FactStudentRecord[StudId]),FILTER('FactStudentRecord','FactStudentRecord'[SchoolId]=EARLIER(FactStudentRecord[SchoolId]))))*100,2)
    Status = IF(FactStudentRecord[Schoolperform]<=60,"Fine",
            IF(FactStudentRecord[Schoolperform]<=75,"AVG","Good"))

    Result:

    You could also download the pbix file to have a view.

     

    Regards,

    Daniel He