This is the code I'm using for calculating the median
Median( Filter( NonEmptyCrossJoin( Descendants([Issue].CurrentMember, [Issue].[Issue]), [Measures].DefaultMember), [Measures].[Issues resolved] > 0 ), DateDiffHours([Issue].get('Created at'), [Issue].get('Resolved at')) )
I'm looking to use a custom date field I have instead of the "Resolved" field. However, 2 issues with that:
Thanks
Hi Peter!
The formula above is looking only at resolved issues (the filter with [Measures].[Issues resolved] > 0), but I imagine you would like to go through all issues no matter if they are resolved or not. In this case you would use the [Measures].[Issues created] > 0 instead.
If the custom field is Date Picker type (instead of Date Time Picker), and you have selected to import this field as Property, the time for Date Picker issue property will be set to that days 00:00:00 in eazyBI. You can still use this in the DateDiffHours function, but note that the hours difference will be calculated with beginning of day. Maybe instead it is better to use the DateDiffDays function that would ignore the time?
To use another Issue property instead of 'Resolved at' you can write this custom fields name in the to_date argument of function. For example, if the custom date field name in JIRA is 'Date for testing' the formula would be as follows
Median( Filter( NonEmptyCrossJoin( Descendants([Issue].CurrentMember, [Issue].[Issue]), [Measures].DefaultMember), [Measures].[Issues created] > 0 ), DateDiffDays([Issue].get('Created at'), [Issue].get('Date for testing')) )
Please let me know if you have any additional questions. Note that you can contact me directly at support@eazybi.com
Kind regards,
Lauma
Hey Lauma, thanks for the answer. I tried this change but it didn't get any results back. Just inserted the field name into [Issue].get('<field name>')). BTW, the field was change to a date-time custom field. Maybe there is a need to add "at"/"on" right after the field's name?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter, To debug this, could you select the Issues dimension on rows and expand some project where issues have the custom date field and then from Measures / Calculated members / Issue properties select the custom date field property on columns - does it show up for issues? You can see exact property name that should be used in the above formula by clicking on edit for the Property calculated Measure. Please send me as screenshot of above report if you still experience problems after finding the Issue property with the custom date. Kind regards, Lauma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Lauma, I was able to get this working by changing the Formatting for that field's Issue Property to Data and Time (was Month Day Year before).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Lauma, maybe you have an idea on how to do this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.