Forum Discussion

LSPbi96's avatar
LSPbi96
New Member
3 years ago
Solved

Calculate the efficiency with accumulated data

Hello Experts, I am new to PowerBi, currently making one report to calculate the efficiency (day used) for hiring. 

I have tried different Measures but still cannot get the accummulated and average. 

 

This is my raw data :

Request Approve DateHiring DateEfficiency (Hiring date minus Request aprove date)

No of People

6-Jan-227-Apr-22911
4-Jan-2225-Apr-221111
24-Jan-2210-May-221061
18-Feb-2210-Jun-221121
19-Apr-2216-Jun-22581
21-Feb-2220-Jun-221191
10-May-2223-Jun-22441
15-Apr-224-Jul-2279.249311
31-Mar-228-Jul-2298.263891
07-Apr-2219-Jul-22102.66111
22-12-2121-Jul-222111
02-Mar-2221-Jul-22140.43131
31-Mar-2215-Aug-22136.26391
21-Feb-2215-Aug-22174.35281
28-12-2116-Aug-222311
24-Jan-2222-Sep-222411
25-Aug-2228-09-22341
05-Mar03-10-225771
02-Aug-2211-10-22701
30-Jun-2228-10-22119.46671
05-Jan-2201-11-223001

 

I will need the data to calculate by monthly basis, the fomula in excel is :

Efficiency = Hiring date - Request aprove date

Monthly time of hiring = (first month) Total up the efficiency of that month / total people hired that month. 

(upcoming months) Total up the efficiency of current month and previous months / total people hired current month and previous months. 

 

Example:

April = (91+111)/(1+1)=101 days

May = (91+111+106)/(1+1+1)=103 days

 

My image of the result is as below: 

MonthEfficiency
Apr101
May103
Jun92
Jul97
Aug113
Sep117
Oct141
Nov150

 

Thank you for attending my post. 

  • LSPbi96 

    you can create a date table and create a measure

    Measure = 
    VAR _eff=sumx(FILTER(all('Table'),'Table'[Hiring Date]<=max('Table'[Hiring Date])),'Table'[Efficiency])
    var  _num=CALCULATE(COUNTROWS('Table'),FILTER(all('Table'),'Table'[Hiring Date]<=max('Table'[Hiring Date])))
    
    return _eff/ _num

    pls see the attachment below

3 Replies

  • LSPbi96 

    you can create a date table and create a measure

    Measure = 
    VAR _eff=sumx(FILTER(all('Table'),'Table'[Hiring Date]<=max('Table'[Hiring Date])),'Table'[Efficiency])
    var  _num=CALCULATE(COUNTROWS('Table'),FILTER(all('Table'),'Table'[Hiring Date]<=max('Table'[Hiring Date])))
    
    return _eff/ _num

    pls see the attachment below