Forum Discussion

briankwlo's avatar
briankwlo
Frequent Visitor
4 years ago
Solved

Making a new table from another table with calculation

Hello,

 

Sample Data:

courseiduseridfullnamecompletion_statedivision
11Reading coursefinishedAAA
12Reading courseNot finishAAA
13Reading courseNot finishBBB
14Reading courseNot finishCCC
15Reading courseNot finishDDD
21PracticalNot finishAAA
22PracticalNot finishAAA
23PracticalfinishedBBB
24PracticalNot finishCCC
25PracticalNot finishDDD

 

 

 

 

with filter courseid = 1:

divisiontotalfinishedpercentage
AAA2150%
BBB100%
CCC100%
DDD100%

 

with filter courseid = 2:

divisiontotalfinishedpercentage
AAA200%
BBB11100%
CCC100%
DDD100%

 

 

Would anyone help about this situation and suggest me how to create a new table for this?

 

Thanks!

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi briankwlo 

     

    You can create the below measures

     

    Finished = CALCULATE(COUNT(Course[division]),Course[completion_state] = "finished")+0
     
    percentage = DIVIDE([Finished],[Total],0)
     
    Total = CALCULATE(COUNT(Course[division]),ALLEXCEPT(Course,Course[courseid],Course[division]))
     
    This is the output of the measures in the table visual

    If this post helps, Accept it as a solution

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi briankwlo 

     

    You can create the below measures

     

    Finished = CALCULATE(COUNT(Course[division]),Course[completion_state] = "finished")+0
     
    percentage = DIVIDE([Finished],[Total],0)
     
    Total = CALCULATE(COUNT(Course[division]),ALLEXCEPT(Course,Course[courseid],Course[division]))
     
    This is the output of the measures in the table visual

    If this post helps, Accept it as a solution

    • briankwlo's avatar
      briankwlo
      Frequent Visitor

      It's work! 

      Thank you esha_shah2002! 

      Have a nice day!