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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sprasad
Helper II
Helper II

Working with Custom Column

Hi,

 

1. I am trying to prepare a bug metrics to check the %age of bug has been fixed till now:

 

%age of Bug fixed is = Total no of Bugs in Closed State/ (Total bugs in Closed State+Total bugs in New State + Total bugs in Active State) * 100.

Below is the table which represents the data. I want to poulate the Custom column with the values using the above formula. How can I do this?

 

ProjectStateCountIssuesCustom
AClosed525525/526
ANew1525/526
BClosed1280
BUClosed1313/20
BUNew713/20
GClosed40
MNew6167/173
MClosed1670
NNew245/(29)
NClosed55/(29)
PNew436/36
PClosed3236/36
RActive11421/440
RNew8421/440
RClosed421421/440

 

How can Iuse the filter on State column in Custom column dialog so that I can filter the records based on State[new]+State[Active] etc?

 

TIA



CustomColumn.PNG

1 ACCEPTED SOLUTION

@sprasad  After performing the steps posted above, then create a new table as below

 

Test187Final = SUMMARIZE(Test187,Test187[Project],"Custom",MAX(Test187[Custom]))

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

5 REPLIES 5
PattemManohar
Community Champion
Community Champion

@sprasad  Please try this as a new column in Modeling tab (DAX) instead of Power Query Editor.

 

Custom = 
VAR _ClosedProjectSum = CALCULATE(SUM(Test187[CountIssues]),FILTER(ALL(Test187),Test187[State]="Closed" && Test187[Project] = EARLIER(Test187[Project])))
VAR _AllProjectSum = CALCULATE(SUM(Test187[CountIssues]),FILTER(ALL(Test187),Test187[Project] = EARLIER(Test187[Project])))
RETURN (_ClosedProjectSum/_AllProjectSum ) * 100

image.png

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Thanks Manohar, It is working correctly. Can we display the %age calculated in Custom column in a single row for each project? 

@sprasad  After performing the steps posted above, then create a new table as below

 

Test187Final = SUMMARIZE(Test187,Test187[Project],"Custom",MAX(Test187[Custom]))

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




@sprasad 

 

As a custom Column, you can use this

 

Please see attached file's query editor

 

ChangedType is the name of previous step

=let  myproject=[Project]
      in
let 
mystates=Table.SelectRows(ChangedType, each [Project]=myproject)[State],

numerator=Table.SelectRows(ChangedType, each [Project]=myproject and [State]="Closed")[CountIssues],

denominator=Table.SelectRows(ChangedType, each [Project]=myproject)[CountIssues] 

in

if List.Contains(mystates,"New") then List.Sum(numerator)/List.Sum(denominator) else 0

Hi Zubair,

Thanks for your help, Actually i couln't work through your code. where can i get the references or help of the code you worte?

 

Thanks

Sudhir

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.