Forum Discussion
Return MAX value into column
- 2 years ago
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
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
- dwightman21762 years agoFrequent Visitor
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!
- dwightman21762 years agoFrequent Visitor
Thanks for coming back to me Phil. Unfortunately I'm just getting blank in every row.
This is the updated query I used:
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)- PhilipTreacy2 years agoSuper User
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
- dwightman21762 years agoFrequent Visitor
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
- dwightman21762 years agoFrequent Visitor
Hi PhilipTreacy
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