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
ScarlettBebb
Frequent Visitor

How to create 3 calculated columns based on a rolling 12 months into FPA

Hello all, 

 

I'm hoping someone can help with this problem. I am trying to create a calculated column to work out a rolling percentage of passing products vs products tested and convert that into a percentage. 

 

I have an example of my data below in the table; 

I would like to create 3 columns in PowerBI from this table. Two of the columns should only count the previous 12months. 

New column 1; Count of Bacthes tested over last 12 months

New column 2; Count of Passed batches over last 12 months

New column 3; =(Passed/Tested)*100 in order to work out a rolling 12 month First Pass Approval rate (FPA)

Original data in table below;

MonthYearProductLotTotal VerdictAttribute(Date)
January2016G3661001-Jan-16
February2016G3891005-Feb-16
March2016G3662005-Mar-16
April2016G3663109-Apr-16
May2016G3664110-May-16
June2016G3892117-Jun-16
July2016G3893106-Jul-16
August2017G3894124-Aug-17
September2017G3895118-Sep-17
October2017G3896124-Oct-17
November2017G3897119-Nov-17
December2017G3898105-Dec-17
January2017G3665006-Jan-17
February2017G3441004-Feb-17
March2017G3442104-Mar-17
April2017G3443103-Apr-17
May2017G3444110-May-17
June2018G3445104-Jun-18
July2018G3446007-Jul-18
August2018G3666002-Aug-18
September2018G3667003-Sep-18
October2018G3668004-Oct-18
November2018G3669001-Nov-18
December2018G3447025-Dec-18

 

So I should end up with the following table in PowerBI;

 

MonthYearProductLotTotal VerdictAttribute(Date)Count of batches tested  (rolling over 12 months)Count of Passing kits (rolling over 12 months) FPA (rolling over 12 months) (Number Passed/Tested X100)
January2016G3661001-Jan-16100
February2016G3891005-Feb-16100
March2016G3662005-Mar-16200
April2016G3663109-Apr-163133
May2016G3664110-May-164250
June2016G3892117-Jun-162150
July2016G3893106-Jul-163267
August2017G3894124-Aug-1711100
September2017G3895118-Sep-1722100
October2017G3896124-Oct-1733100
November2017G3897119-Nov-1744100
December2017G3898105-Dec-1755100
January2017G3665006-Jan-175240
February2017G3441004-Feb-17100
March2017G3442104-Mar-172150
April2017G3443103-Apr-173267
May2017G3444110-May-174375
June2018G3445104-Jun-1811100
July2018G3446007-Jul-182150
August2018G3666002-Aug-18400
September2018G3667003-Sep-18400
October2018G3668004-Oct-18400
November2018G3669001-Nov-18500
December2018G3447025-Dec-183133

 

Thanks, 

 

Scarlett

 

3 REPLIES 3
v-stephen-msft
Community Support
Community Support

Hi @ScarlettBebb ,

 

Sorry, not very clear. I need more details.

Which column is your [Count of batches tested (rolling over 12 months)] calculated on? [ Count of batches tested (rolling over 12 months)] is calculated based on which column? Do these two columns need to be grouped according to [Product]?

If possible, please give an example of how 4 and 2 are calculated.

vstephenmsft_0-1686278222520.png

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Morning Stephen 

 

Thank you for getting back to me on this. I need to create a 3 columns to calcuate the 4 and 2 highlighted in the screenshot. I counted them myself to get the answer in the table shown. 

So for example the 4 in column 'Count of batches tested' is worked out by counting the number product 'G366' and lot tested in the last 12months. This should be calcuated from a count of Product column and Lot column and then specifically over a 12 month period. 

Then the column 'Count of Passing Kits' is calculated from ther Total Verdict column where 1=PASS and 0=Fail. So counting how many of the 4 batches tested has passed over that 12months gives 2 for that product. 

 

Thanks, 

 

Scarlett

@v-stephen-msft 

Apologies I forgot to tag you in my reply. Please see above for more details on the calculated columns I'm trying to make 

Any help would be appreciated! 

Thanks 

 

Scarlett

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.