Forum Discussion
Gantt Chart - date filter
Hi nhoward , Anonymous ,
Thanks a lot for your replies!
I will try Anonymous solution later today, and will let you know if that works (tho not sure how that is going to work, but will give it a chance ! )
nhoward if you find any other solution, please let me know! Will appreciate 🙂
HI Kopek,
I finally got back to trying to solve this for my Leave Requests Gantt Chart. The biggest hurdle is that PBI doesn't do: Date > Date. In excel you can because a date is a number, but in PBI a date is text field.
I figured away around it, but had to add columns to by leave request table, I used DATEDIFF, to get an amount of days compared to NOW().
Some background. Leave Requests have a LeaveDate and a dateTo (ie start and end). So if the start date is before now, and the end date is after now, I want to use now as the start date. Then my Gantt chart that shows request in the next 90 days, will pickup these requests too.
Using DateDiff yields either a negative or postive number. Negative means that the request date is after now, and Postive means that the request date is before now.
I created 3 columns, but you could combine the formulas into one.
DateDiffStart = DATEDIFF(HRLeaveRequest[LeaveDate], NOW(), Day)
DateDiffEnd = DATEDIFF(HRLeaveRequest[dateTo], NOW() ,DAY)
DateFrom (ie alternate start date) = IF(AND(HRLeaveRequest[DateDiffStart]>0,HRLeaveRequest[DateDiffEnd]<0),DATEVALUE(NOW()),HRLeaveRequest[LeaveDate])
I know that this is different to your requirments for an alternate start date equal to the start of the filtered month, but this might give you a starting point.
Hope that helps.