Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
anshpalash
Helper II
Helper II

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!

1 ACCEPTED SOLUTION
hrishi
Helper I
Helper I

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

View solution in original post

2 REPLIES 2
hrishi
Helper I
Helper I

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

Thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.