Limit displayed timeframe for a 'gantt' (made from barchart)?

I added a ‘gantt’ made from a barchart by following the guidance on this documentation page and looking at the sample report Blocker Story Plan (Bar as Gantt) - Issues - Jira Demo - eazyBI.

I need to use this format rather than the true gantt because we have milestones that need to be displayed that are captured as custom fields on each issue and we need the range to be shown as a solid bar (for the start to the end dates).

I have been able to successfully create the chart, and it displays as needed with the exception that I cannot seem to control the timeframe that is displayed.

The visualization shows from the earliest year in the data (in the sample data provided below this would be 2012, to the latest 2032. I want to be able to ‘zoom’ in the visualization so that only a current window is visible such as 12 months, starting one month back.

I have been reading through documentation trying to get a better grasp on the time portion, but I am not sure how to handle this situation where each date is from a separate field.

All that to ask, can anyone help me understand how can I narrow the range for what years/months are visible displayed for this use case?

Thank you


This is a sample of what the data looks like when in the table layout:

Name StartDate EndDate Milestone1 Milestone2 Milestone3
Effort1 1/1/2012 1/31/2026 3/25/2014 7/1/2018 11/4/2023
Effort2 6/7/2019 5/31/2024 3/25/2014 7/1/2020 11/4/2022
Effort3 7/29/2023 3/31/2029 9/25/2023 12/1/2024 6/1/2027
Effort4 5/1/2024 4/30/2032 7/25/2024 1/1/2026 6/1/2029

Hi @bri8

Welcome to eazyBI Community! Thanks for posting this question!
I am very glad to hear you tried to do the research on your own to find an answer. Although this is not written in the documentation page, I have created a feature request to potentially look for possibilities to adjust the axis time more easily.
Otherwise, here is a solution I would like for you to try on your data and see if that works for you.
Your main “problem” is the date range, which in this case is reflected by Start and End dates. You may need to adjust the measure names (use the autofill functionality). Here is how my initial report looks. I created the same fields as you have to make it easier to understand the steps

This is the report I created with similar dates you provided in your table:

Step 1 : define 2 new measures for the Issue start date and issue end date. Based on you requirement. If the issue start date is older than previous month, then formula will return the date which was 1 month ago.
Similarly for the End date. If the End date is longer than 1 year from now, it will return the date which is going to be one year from now, other wise - it will return the actual End Date

Here is the Formula for “Start date”. I have named the measure “Check for Issue Start Date

CASE
WHEN
DateCompare([Measures].[Issue Start Date],
"1 year from now") <= 0 AND
DateCompare([Measures].[Issue Start Date],
"1 month ago") < 0
THEN
DateParse("1 month ago")
WHEN

DateCompare([Measures].[Issue Start Date],
"1 year from now") <= 0 AND
DateCompare([Measures].[Issue Start Date],
"1 month ago") > 0
THEN
DateParse([Measures].[Issue Start Date])
END

Here is the formula “Check for End Date

CASE
WHEN
DateCompare([Measures].[Issue End Date],
"1 year from now") >= 0 AND
DateCompare([Measures].[Issue End Date],
"1 month ago") > 0
THEN
DateParse("1 year from now")
WHEN

DateCompare([Measures].[Issue End Date],
"1 year from now") <= 0 AND
DateCompare([Measures].[Issue End Date],
"1 month ago") > 0
THEN
DateParse([Measures].[Issue End Date])
END

Step 2: define 3 new measures with the formula below. I’m only pasting the example for Milestone 1, but use the same formula, replacing “Milestone 1” with Milestone 2 and Milestone 3

CASE  
WHEN
DateBetween(
  [Measures].[Issue Milestone1],
  "1 month ago",
  "1 year from now"
)
THEN
 [Measures].[Issue Milestone1]
 END

Step 3. And lastly, you need to create a measure with formula below so you can apply a row filter on this measure. I have named the measure “Filter report

CASE
WHEN
DateCompare(TimestampToDate(Max(
  {[Measures].[Check for Issue Start date],
  [Measures].[Check for End date],
  [Measures].[Check for Milestone 1],
  [Measures].[Check for Milestone 2],
  [Measures].[Check for Milestone 3] 
  },
    DateToTimestamp([Measures].CurrentMember.Value)
 )
),
"1 month ago"
)
>=0
AND
DateCompare(TimestampToDate(Min(
  {[Measures].[Check for Issue Start date],
  [Measures].[Check for End date],
  [Measures].[Check for Milestone 1],
  [Measures].[Check for Milestone 2],
  [Measures].[Check for Milestone 3] 
  },
    DateToTimestamp([Measures].CurrentMember.Value)
 )
),
"1 year from now"
)
<=0
AND
NOT IsEmpty([Measures].[Check for Issue Start date]) AND
NOT IsEmpty([Measures].[Check for End date])
THEN
1
END

Once you have applied the filter, you should remove it form your report, but the filter should remain active in the background.

This is how the final result might look:

I hope this is what you were looking for!
Best wishes,

Elita from support@eazybi.com

Thank you so much @Elita.Kalane - this was very helpful, and I appreciate you adding a feature request.

1 Like