Forum Discussion

IanT76's avatar
IanT76
Helper I
6 years ago
Solved

Calculate frequency using pre-determined formulae

I'm looking to display a lot of historic safety statistics & frequencies, using our industry's pre-determined calculations, with one example being First Aid Case frequency (FACf);

  • FACf = No. of First Aid Cases per 200,000 Hours Worked.

 

I have all hours worked data, incident type numbers, dates etc, and have succesfuly managed to graph actual numbers of Hours Worked and First Aid cases (per month and running total for Year to Date), and I have built the FACf formula in a new column, FACfCalc;

  • FACfCalc = ((200000*Table_query__3[FAC's])/Table_query__3[Hours Worked])

 

But the formula is not returning the correct results...looking at January in below example, 5 FAC's with 430,000 Hours Worked in the month should return an FACf of 2.32 (200,000 * 5) / 430,000) but it's not working....

 

I've tried both possible variations of the formula (200k / Hours * FAC's and 200k * FAC's / Hours) but no luck!  Any help gratefully appreciated!

 

 
  • Hi, IanT76 

     

    I'd like to suggest you create a measure as below.

     

    Result = 
    var _month = SELECTEDVALUE('Table'[Month])
    return
    (
        200000*
        CALCULATE(
            SUM('Table'[FAC's]),
            'Table'[Month] = _month
        )
    )/
    CALCULATE(
        SUM('Table'[Hours Worked]),
        'Table'[Month] = _month
    )

     

     

    Result:

     

    Best Regards

    Allan

     

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

4 Replies

  • v-alq-msft's avatar
    v-alq-msft
    Community Support

    Hi, IanT76 

     

    I'd like to suggest you create a measure as below.

     

    Result = 
    var _month = SELECTEDVALUE('Table'[Month])
    return
    (
        200000*
        CALCULATE(
            SUM('Table'[FAC's]),
            'Table'[Month] = _month
        )
    )/
    CALCULATE(
        SUM('Table'[Hours Worked]),
        'Table'[Month] = _month
    )

     

     

    Result:

     

    Best Regards

    Allan

     

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

    • IanT76's avatar
      IanT76
      Helper I

      Hi Amit,

       

      Sample data is below and desired output is as per graphs in original post; the top 2 graphs are working correctly but the bottom one (showing FACf) is not....

       

      CountryYearMonthHours WorkedFAC's

      FACf - calculated manually as

      ((200,000 / Hours Worked ) * FAC's)

      A2015January13248800.00
      A2015February15441611.30
      A2015March17582000.00
      A2015April17631211.13
      A2015May18105611.10
      A2015June17595200.00
      A2015July17340400.00
      A2015August17359200.00
      A2015September14719200.00
      A2015October16145600.00
      A2015November14774400.00
      A2015December14738800.00
      D2015January1140800.00
      D2015February1073600.00
      D2015March1140800.00
      D2015April1073600.00
      D2015May1092000.00
      D2015June1126400.00
      D2015July1177600.00
      D2015August1108800.00
      D2015September1144000.00
      D2015October1144000.00
      D2015November1179200.00
      D2015December1288000.00
      G2015January10857647.37
      G2015February9865624.05
      G2015March10894459.18
      G2015April10537611.90
      G2015May10672800.00
      G2015June6938425.77
      G2015July7156038.38
      G2015August5590813.58
      G2015September5408000.00
      G2015October4661228.58
      G2015November4525614.42
      G2015December4235614.72
      K2015January3508800.00
      K2015February3820800.00
      K2015March4941600.00
      K2015April4380000.00
      K2015May5674800.00
      K2015June6036000.00
      K2015July5071600.00
      K2015August7179600.00
      K2015September5693600.00
      K2015October4935200.00
      K2015November5081600.00
      K2015December3844000.00
      M2015January13825211.45
      M2015February12668800.00
      M2015March14253200.00
      M2015April13492011.48
      M2015May15285600.00
      M2015June15112800.00
      M2015July15592811.28
      M2015August16923600.00
      M2015September16627200.00
      M2015October17353611.15
      M2015November17617600.00
      M2015December17993600.00
      MONTH TOTAL2015January42581252.35
      MONTH TOTAL2015February42870431.40
      MONTH TOTAL2015March48812052.05
      MONTH TOTAL2015April47114431.27
      MONTH TOTAL2015May50830810.39
      MONTH TOTAL2015June46808820.85
      MONTH TOTAL2015July46338441.73
      MONTH TOTAL2015August48162010.42
      MONTH TOTAL2015September43592000.00
      MONTH TOTAL2015October44239631.36
      MONTH TOTAL2015November43178410.46
      MONTH TOTAL2015December42100010.48
      YEAR TOTAL2015 5466280291.06