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.
My data model:
CONF_STATUS_FLOW contains Jira status' sequence, example for specific Jira project:
As an input parameters I have:
- From Status: "Epic: in fast scan" (sequence: 3 in CONF_STATUS_FLOW)
- To Status: "Epic: in progress" (sequence: 7 in CONF_STATUS_FLOW)
Challenges:
1) Get range of eligible sequences from CONF_STATUS_FLOW, based on STG_JIRA_ISSUE values from [Project Key], [Issue Type].
As a result for [Issue Type] = "Epic", it would be {3, 4, 5, 6, 7} for specific Project in Jira.
2) Based on Sequence range {3, 4, 5, 6, 7} find eligible records in STG_JIRA_STATUS table and identify if [StatusID] = XXXX is within this range or not by returning StatusID.
3) Do all this in DAX measure.
Current Code, which is very slow (takes couple of minutes):
Test_Measure := VAR status_id_field = FIRSTNONBLANK ( STG_JIRA_STATUS[StatusID], MIN ( STG_JIRA_STATUS[StatusID] ) ) VAR bss_project_value = FIRSTNONBLANK ( STG_JIRA_ISSUE[Project Key], MIN ( STG_JIRA_ISSUE[Project Key] ) ) VAR bss_from_status_value = "Epic: in fast scan" VAR bss_to_status_value = "Epic: in progress" VAR bss_issue_type = "Epic" VAR bss_from_status_seq = CALCULATE ( VALUES ( CONF_STATUS_FLOW[Sequence] ), CONF_STATUS_FLOW[Project Key] = bss_project_value, CONF_STATUS_FLOW[Issue Type] = bss_issue_type, CONF_STATUS_FLOW[Status] = bss_from_status_value ) VAR bss_to_status_seq = CALCULATE ( VALUES ( CONF_STATUS_FLOW[Sequence] ), CONF_STATUS_FLOW[Project Key] = bss_project_value, CONF_STATUS_FLOW[Issue Type] = bss_issue_type, CONF_STATUS_FLOW[Status] = bss_to_status_value ) VAR bss_status_value = CALCULATETABLE ( VALUES ( STG_JIRA_STATUS[StatusID] ), STG_JIRA_STATUS[Status Sequence] >= bss_from_status_seq, STG_JIRA_STATUS[Status Sequence] <= bss_to_status_seq ) RETURN SWITCH ( TRUE (), status_id_field IN bss_status_value, status_id_field )
@Anonymous ,
DAX Studio can be used to capture queries, you may have a look.
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |