Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi. If anyone could help with this I would be most appreciative 🙂
As a bit of background:
What I am trying to get to, is a new column called MAX Downtime per Incident, which contains the MAX downtime value from the different sub-tasks related to each parent incident. Hopefully the following image helps
Thanks in advance
David
Solved! Go to Solution.
Download PBIX file with the example below
This works for me
MAX Downtime Per Incident =
VAR _MaxDT = CALCULATE(MAX('DataTable'[Downtime]), FILTER(ALL('DataTable'), SELECTEDVALUE('DataTable'[Issue ID]) = 'DataTable'[Parent ID]))
RETURN IF(SELECTEDVALUE('DataTable'[Issue Type]) = "Incident", _MaxDT)
In the table visual make sure that Issue ID is set to Show items with no data
Regards
Phil
Proud to be a Super User!
In your first post you showed columns ID and Parent ID. I don't see Parent ID in the file.
In your measure you wrote
MAX Downtime Per Incident =
VAR _MaxDT = CALCULATE(MAX('Issues'[Downtime]), FILTER(ALL('Issues'), SELECTEDVALUE('Issues'[ISSUE_KEY]) = 'Issues'[ISSUE_PARENT_ISSUE_KEY]))
RETURN IF(SELECTEDVALUE('Issues'[Issue Type]) = "Incident", _MaxDT)
where you are trying to use the ISSUE_KEY and ISSUE_PARENT_ISSUE_KEY columns but looking at the data, the data isn't structured in the way you used in your example?
Shouldn't the 2nd, 3rd and 4th rows have ISSUE_PARENT_ISSUE_KEY TSO-16868?
Similarly for the other data I've highlighted, they don't follow the same ID->Parent ID pattern you used in your original example.
Phil
Proud to be a Super User!
Hi @PhilipTreacy.
Thanks for coming back to me. The image I included in my original post was just done for ease of understanding really. Issue ID is actually ISSUE_KEY and Parent ID is actually ISSUE_PARENT_ISSUE_KEY.
In terms of the structure of the ticket data, then again, my original message was done for ease of documentation and explanation. It does not necessarily follow that entries which follow an incident in the table will be the child sub-tasks for that incident. The reason is that, from a process perspective, we raise a sub-task once an incident has been resolved, so if it runs for several days, then obviously there could be many tickets logged between the original incident and subsequent sub-tasks.
The re-worked table below shows how the data could be structured in the table
I hope that explains matters a little and apologies if I've caused some confusion.
Regards
David
Download PBIX file with the example below
This works for me
MAX Downtime Per Incident =
VAR _MaxDT = CALCULATE(MAX('DataTable'[Downtime]), FILTER(ALL('DataTable'), SELECTEDVALUE('DataTable'[Issue ID]) = 'DataTable'[Parent ID]))
RETURN IF(SELECTEDVALUE('DataTable'[Issue Type]) = "Incident", _MaxDT)
In the table visual make sure that Issue ID is set to Show items with no data
Regards
Phil
Proud to be a Super User!
The solution you gave populates the MAX downtime value in a table visual, but is there a way to get the same value populated in a calculated column, so that it returns the MAX value for rows which have incidents, but returns a blank for the rows that relate to sub-tasks?
Thanks
David
Hi @PhilipTreacy ,
Ignore my last message - my table was filtered on a date field that only exists in Sub-tasks, so it wasn't showing any incidents. Once I remove that, the Max value is being displayed.
Thank you so much!
Thanks for coming back to me Phil. Unfortunately I'm just getting blank in every row.
This is the updated query I used:
Can you please supply your actual data, or even better your PBIX file, so I can look at it and write the DAX to work with that.
Regards
Phil
Proud to be a Super User!
Hi @PhilipTreacy . How do I attach a PBIX file as I get an error saying I cannot attach that file type (same with Excel)
Thanks
David
Prob easiest to load the file to somewhere like OneDrive or Google Drive and then link to it from here.
Phil
Proud to be a Super User!
Hi @PhilipTreacy , hopefully Dropbox is OK?
I've attached a version of the data and PBIX file...hopefully it helps.
Basically we report uptime % in our weekly and monthly reports, which is all based on Sub-task data as that is where we record accurate downtime minutes for each incident.
For a quarterly report that we now produce, we have a to report uptime % based on the number of unique incidents, so I need to take the MAX downtime figure from the one or more sub-tasks that relate to each P1 or P2 incident, and use that in the uptime % calculation. That's why I wanted the MAX Downtime figure in the calculated colunn, so I could just replicate the same calculation we use for the weekly and monthly uptime %.
Thanks
David
User | Count |
---|---|
107 | |
87 | |
81 | |
76 | |
71 |
User | Count |
---|---|
112 | |
105 | |
96 | |
74 | |
66 |