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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
PBI_newuser
Post Prodigy
Post Prodigy

How to calculate the accuracy % by using measure

Hi, I have the below sample data and wanted to calculate the accuracy of the estimate parts.

For example, for WO-111, the system estimate there are 3 different parts will be used but only one part (Part A) is actually used. Hence, the accuracy of the system is 1/3=33%.

If the WO Number has no Estimate parts, then we exclude them from the calculation.

If the estimate is not used in the WO, then the accuracy should be calculated as 0%.

 

Can anyone please advise how to come out with the measure for this "Accuracy" calculation?

The objective is to see if the accuracy improve over time.

 

Sample Data:

DateWO NumberPartRecord Type
05-01-20WO-111AEstimate
05-01-20WO-111BEstimate
05-01-20WO-111CEstimate
05-01-20WO-111AUsage/Consumption
05-01-20WO-111DUsage/Consumption
05-01-20WO-111EUsage/Consumption
12-10-20WO-222AUsage/Consumption
12-10-20WO-222BUsage/Consumption
12-10-20WO-222CUsage/Consumption
09-02-21WO-333AEstimate
09-02-21WO-333BUsage/Consumption
09-02-21WO-333CUsage/Consumption
16-04-21WO-444EEstimate

 

Expected Output:

DateWO NumberAccuracy
05-01-20WO-11133%
12-10-20WO-222Exclude in the calculation if there is no Estimate in the same WO Number
09-02-21WO-3330%
16-04-21WO-4440%
1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@PBI_newuser 

you can create a column

Column = if('Table'[Record Type]="Estimate",maxx(FILTER('Table','Table'[Date]=EARLIER('Table'[Date])&&'Table'[WO Number]=EARLIER('Table'[WO Number])&&'Table'[Part]=EARLIER('Table'[Part])&&'Table'[Record Type]<>"Estimate"),'Table'[Record Type]))

then create a measure

Measure = 
VAR _count_estimate=CALCULATE(COUNTROWS('Table'),'Table'[Record Type]="Estimate")
VAR _count=CALCULATE(COUNTROWS('Table'),not(ISBLANK('Table'[Column])))+0
return if(ISBLANK(_count_estimate),BLANK(),DIVIDE(_count,_count_estimate))

1.PNG

please see the attachment below

 





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
ryan_mayu
Super User
Super User

@PBI_newuser 

you can create a column

Column = if('Table'[Record Type]="Estimate",maxx(FILTER('Table','Table'[Date]=EARLIER('Table'[Date])&&'Table'[WO Number]=EARLIER('Table'[WO Number])&&'Table'[Part]=EARLIER('Table'[Part])&&'Table'[Record Type]<>"Estimate"),'Table'[Record Type]))

then create a measure

Measure = 
VAR _count_estimate=CALCULATE(COUNTROWS('Table'),'Table'[Record Type]="Estimate")
VAR _count=CALCULATE(COUNTROWS('Table'),not(ISBLANK('Table'[Column])))+0
return if(ISBLANK(_count_estimate),BLANK(),DIVIDE(_count,_count_estimate))

1.PNG

please see the attachment below

 





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

Proud to be a Super User!




amitchandak
Super User
Super User

@PBI_newuser , Try a new measure like

 

 

Measure = var _tab = FILTER(SUMMARIZE('Table', 'Table'[WO Number], 'Table'[Part], "_1", DISTINCTCOUNT('Table'[Record Type])), [_1] >=2) 
var _2  = COUNTX(VALUES('Table'[WO Number]), if(CALCULATE(DISTINCTCOUNT('Table'[Record Type]), FILTER('Table', 'Table'[Record Type] = "Estimate"))+0 >0, [WO Number], BLANK()))
return 
 DIVIDE(COUNTX(_tab,[WO Number])+0,_2)

 

 

Please find file after Signature

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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