There are a couple of ways to go about it, with varying speeds of process. You might need to test to find the best way. Also, it helps to understand the various options that might be available in case they might help you solve another problem down the line.
The important part to all of these solutions is that the DateDiff() function takes a Units argument that determines the unit of the answer. If you don't provide it, DateDiff() returns a value of days, which is probably why you aren't seeing the nuance of each potential score deviation.
Solve it with an If() Statement
The If() statement is already branch-able, so you don't need to embed another If()... but to do it with an if statement will require a test for each level of result in your table.
Set( varTimeliness,
If(
DateDiff( DatePicker1.SelectedDate, DatePicker2.SelectedDate, Minutes) <= 0, 100,
DateDiff( DatePicker1.SelectedDate, DatePicker2.SelectedDate, Minutes) <= 179, 95,
DateDiff( DatePicker1.SelectedDate, DatePicker2.SelectedDate, Minutes) <= 299, 90,
DateDiff( DatePicker1.SelectedDate, DatePicker2.SelectedDate, Minutes) <= 419, 85,
DateDiff( DatePicker1.SelectedDate, DatePicker2.SelectedDate, Minutes) <= 539, 80,
DateDiff( DatePicker1.SelectedDate, DatePicker2.SelectedDate, Minutes) <= 659, 75,
DateDiff( DatePicker1.SelectedDate, DatePicker2.SelectedDate, Minutes) <= 779, 70,
65
)
Solve it with a Collection
This would be a more forward-scalable solution, so a situation where your scoring matrix might change in the future would argue for a setup like this... though it might be quicker in process (and easier to maintain) even without the idea that your requirements might change in the future.
The basic idea would be to establish a Collection where you have a matrix of 2 fields per entry: the score, and the max minutes to earn that score. That can be set up early in your app, even in the OnStart() property. Then you would check the results of the DateDiff() function against the Collection, using a statement like:
First(
SortByColumns(
Filter(
yourCollection,
yourMaxMinutesField >= DateDiff(DateDiff( DatePicker1.SelectedDate, DatePicker2.SelectedDate, Minutes)
),
SortOrder.Ascending
)
).yourScoreField
So, starting from the inside out...
Filter()... pulls all of the records where the yourMaxMinutes field is greater than the DateDiff() function... meaning, the best score the person qualifies for and all the rest.
SortByColumns()... puts those in ascending order... meaning that the smallest yourMaxMinutes will be the first record in the returned set, which represents the best score they could qualify for.
First().yourScoreField... gets the first record (the best score), and specifically returns the score field from that record.
Either one of these would work. The second one consolidates any future alterations to the grading or formula to one location (the point where you create your Collection) rather than anywhere you want to generate a score. You can reference that Collection everywhere, and your formula to return the score will always remain the same. If you have 20 places where you compare numbers to generate the score, you only have to change the solution plot once - at the Collection - rather than for each of the 20 implementations.
Post back if you need help with the ClearCollect() statement to create the Collection.