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
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

Regards
Zubair

Please try my custom visuals

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
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.