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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Diane_Gribi
Helper I
Helper I

Calculating FPU using distinct counts

DateInspectStageMOPlant NumberProductFault CodeWeek NumMonth QtrYear
01/01/01Test100111ABC100Product APass1JanQ101
02/01/01Test100112ABC101Product AInc Wiring1JanQ101
02/01/01Test100112ABC101Product AFluid Leak1JanQ101
02/01/01Test100113XYZ100Product BPass1JanQ101
02/01/01Test100114XYZ101Product BFluid Leak1JanQ101
02/01/01Test100114XYZ101Product BInc Wiring1JanQ101
08/01/01Test100115ABC102Product AFluid Leak2JanQ101
08/01/01Test100115ABC102Product AFluid Leak2JanQ101
09/01/01Test100116XZY102Product B

Pass

2JanQ101

 

Hi - Here is the table.  What I am looking to calculate is - 

By Week, Month, Qtr and Year

1) Qty of Fails (anything that doesn't have pass in the fault code field)

2) Qty Units that have fails

3) Qty Unit with 0 faults (Any line that has pass in the fault code field)

4) FPU (No of fails/Total Qty Units (qty unit with fails + qty unit with 0 fails))

5) FPY (No of units with 0 fails/Total Qty Units (qty unit with fails + qty unit with 0 fails))

I have a reasonable handle on calculating 1, 2 (using the MO number with a distinct count) and 3 but these are in different visuals.  I am struggling to get it to calculate 4 and 5 as I cant get the DAX code or calculation to add a criteria into my distinct count to only count the MO's with a pass + MO's without stating pass

When I try to do in the same visual the table counts the fail lines as a fail.

 

I am looking to create a visual that shows the following - 

ProductQty FailsQty Units with FailsQty Units with no failsFPU (Fails/(units with fails + units with no fails)FPY (Qty units with no fails/(units with fails + units with no fails) 
Product A4211.3333% 
Product B2120.6666% 
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Diane_Gribi 
Please refer to attached sample file with the solution

1.png

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @Diane_Gribi 
Please refer to attached sample file with the solution

1.png

Thanks.  Is there a way to make the MO column the columns for counting distinct units based on having a fault or not?

 

@Diane_Gribi 
Yes of course just change the column name in dax code

Thanks you so much, I have spent weeks trying to solve this.  It works as exactly as I need it to.  I have accepted the solution above.  Thanks again

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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