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

Bradford factor Calculation

Hello All, 

 

First time posting.

 

For those of you unaware f the Bradford factor, it is a formula used to calculate a figure based on absenteeism 

S2 x D = B

  • S is the total number of separate absences by an individual
  • D is the total number of days of absence of that individual
  • B is the Bradford Factor score

I have a table which pulls from a time and attendance database, I have used filters and to get the data I require and have used Is Consecutive = COUNTROWS('TABLENAME) to get consecutive days of records. 

 

I'm now stumped, I need to calculate the above calculation, but all I get is syntax errors

1 ACCEPTED SOLUTION

Thanks for that Simon.

 

Here is my suggested approach - uploaded with simplified data here:

https://www.dropbox.com/s/gt1jytqobrc9ilt/Bradford%20Factor.pbix?dl=0

 

  1. Add a Block Index column to your original table, so that Block Index has a different value for each block of consecutive days with the same value of Abs, across all ClockNos.
    To do this, I carried out a series of steps in the Query Editor:
    1. Sort the rows by ClockNo & Date
    2. Group the rows by ClockNo & Abs, using GroupKind.Local, which groups each consecutive block of ClockNo & Abs values.
    3. Add a Block Index column to the resulting grouped table.
    4. Re-expand the grouped rows, then tidy up.
  2. Create a Separate Absences measure, which is a DISTINCTCOUNT of Block Index where Abs="2".
  3. Create a Days Absent measure, which counts rows of the table where Abs="2".
  4. Create a Bradford Factor measure equal to [Separate Absences] ^ 2 * [Days Absent]

 

The measures in the end are:

Separate Absences = 
CALCULATE (
    DISTINCTCOUNT ( 'Bradford Factor'[Block Index] ),
    'Bradford Factor'[Abs] = "2"
)

Days Absent = 
CALCULATE (
    COUNTROWS ( 'Bradford Factor' ),
    'Bradford Factor'[Abs] = "2"
)

Bradford Factor = 
IF (
    HASONEVALUE ( 'Bradford Factor'[ClockNo] ),
    // Only calculate for one ClockNo at a time, and don't aggregate ClockNos
    [Separate Absences]
        ^ 2
        * [Days Absent]
)

Bradford Factor here doesn't aggregate ClockNos, but you could aggregate using AVERAGEX or some other method if you want.

 

Hopefully this does what you expect and can be applied to your data model.

 

Cheers,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

12 REPLIES 12

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.