"Open Issues" translate to SQL

Hi Eazy BI community,

Context:
I would like to make a transition from EazyBI to PowerBI. In order to manipulate with data in PowerBI, I should create view in JIRA_DB to remove the “noice” from data (EazyBI API is not applicable option in our case due to it’s bad performance).

Question: Did someone try to reproduce “Open issues” cube behaviour via SQL?

Current challenge: I should select X amount of issues from table “ISSUE” according to it’s historical state in particular period taken from table “ISSUE_FIELD_HISTORY”

Official definition:
Measure Open issues is a total count of created issues until the period end minus a total count of resolved issues until the period end. eazyBI considers the issue resolved if it has a resolution date