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.
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
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
Solved! Go to 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
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
Hm,
I guess it is not that simple, as to use this simple formula:
B = CALCULATE( SUMX('Table', S2 * D) )
Can you please provide some sample data
In the table you have shown:
To make it easy to calculate the Bradford Factor with a measure, I am anticipating it might be best to add a column identifying the 'absence block'.
Hello Owen
The ClockNo identifies the employee, this is tied to a seperate database with a relationship that identifies the employees names.
The Abs column contains the value that dictates whether they are absent or not, 2 is unauthorised, H is holiday ect.
I am purely targeting the unauthorised at the minute.
I appreciate any help you can offer
Simon
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
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
Hello Owen.
I followed your instructions to the letter, but when I come to visualise the data it just shows a count of the number of absences.
I'm lost again.... have attached my saved file.
https://www.dropbox.com/s/wd2ifxpu0qaxl1h/post%20bradford%20factor.pbix?dl=0
I'm gonna keep trying with it, but again I'd appreciate your help
Cheers
Simon
No worries Simon
The key part that was missing was, in the "Group By" step, you need to provide a fourth argument to the Table.Group function equal to GroupKind.Local. This ensures that contiguous blocks are treated as groups. This isn't an option in the "Group By' dialog box so you have to edit the code after creating that step. If you don't provide this argument, for example all the "2"s from one ClockNo are grouped together, regardless of whether they occurred in a contiguous block.
I would also suggest when you expand the grouped table, don't expand Abs and ClockNo (otherwise you end up with duplicate columns) and remove all the prefixes in the expanded column names.
Otherwise the measure definitions look fine 🙂
I've made those changes and reuploaded here
https://www.dropbox.com/s/t2po0u5qhgnl8sx/post%20bradford%20factor%20-%20Owen%20edit.pbix?dl=0
But I can't verify it works since I don't have access to your ODBC data source so the table can't update.
Please post back if it's not working or doesn't make sense.
Cheers,
Owen 🙂
Thanks Owen
Thats worked perfect
You're an absolute Star, couldn't have done it without you.
Thanks again
Simon
Please excuse, but as I asked for some sampledata, I meant data, that I / we can easily reproduce, a downloadable textfile or pbix.
I also realize, that I'm not able to identify the columns S2 and D you mentioned in your formula. Can you also please give some more information why it's important that day of absence are consecutive.
Thanks
Sorry Tom
I'm new to this program and this forum as well.
I thought by making it consecutive it would make it easier for me to visualise the total duration of time off and be able to see the multiple instances easier.
All I want to do is count total absences and count instances of absences and do that calculation,
I'm not sure how to attach a file either....
Simon
Hello All,
First time posting.
For those of you unaware the Bradford factor, it is a formula used to calculate a figure based on absenteeism
S2 x D = B
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.
Cheers in advance
Simon
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
100 | |
99 | |
76 | |
66 | |
61 |
User | Count |
---|---|
142 | |
106 | |
103 | |
85 | |
70 |