Forum Discussion

anshpalash's avatar
anshpalash
Helper II
4 years ago
Solved

Division Calculation by Filters

Hi all,

 

I have a dataset similar to the form:

MonthDefect CodeDefect Count
121210
160020
166510
299915
290015
213710

 

I want to calculate defect% per month and defect code. For example, the defect% for month 1 and code 212 would be the number of defects for the code 212 in month 1 divided by the total number of defects in that month. So, defect% in this case would be 10/(10+20+10) = 0.25 or 25%.

I want to create a line graph that would show defect%. In this line graph, the axis would be months (1,2,..), the legend would be defect codes and the values would be defect%. Can anyone please help me on how I can achieve this? Thank you!

  • Anonymous's avatar
    Anonymous
    4 years ago
    Create a column and paste this code 
     
    Column = DIVIDE('Table'[Defect Count],CALCULATE(SUM('Table'[Defect Count]), ALLEXCEPT('Table','Table'[Month])),0)

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable
    Create a column and paste this code 
     
    Column = DIVIDE('Table'[Defect Count],CALCULATE(SUM('Table'[Defect Count]), ALLEXCEPT('Table','Table'[Month])),0)