How can I calculate the contractual penalties for issues that are in SLA breached?

If you want the same on eazyBI for Jira Cloud, try these settings to define the calculated field:

[jira.customfield_sla1_goal]
data_type="decimal"
name = "SLA 1 goal"
measure = true
javascript_code = '''
var hours=0.0;
if (issue.fields.customfield_NNNNN){
	cCycles = issue.fields.customfield_NNNNN.completedCycles;
	if (cCycles && cCycles.length>0) {
		hours=cCycles[0].goalDuration.millis/1000/3600;
	} else {
		oCycle=issue.fields.customfield_NNNNN.ongoingCycle;
		if (oCycle && oCycle.length>0) {
			hours = (oCycle.elapsedTime.millis+oCycle.remainingTime.millis)/1000/3600;
		}
	}
}
if (hours>0) {
return hours;
}
'''

Martins / support@eazybi.com