Forum Discussion

Razaning's avatar
Razaning
Frequent Visitor
3 years ago

Date Slicer

Good day! 

I'm building a projct management dashboard and i need support to achieve the requiremnts. 

My main data table is simialr to the following : 

 project id       project name       phase        start date     end date         Area   
189Aphase 1 1/1/202020/12/2022F2
130Cphase 35/2/202118/6/2021R1
130Cphase 41/7/20215/5/2023R1

 

I want to do some analysis in the data... ex. i want to calculate number of projects in each area in a certain year. 

I'm facing 2 issues here:

 

1st- I'm using gantt chart and do this i must disconnect the table "date" so i can filter the chart view. And connincting the 2 tables through the dax bellow.

 

 

 

 

Measure = var _start_date = MAX('Date'[Date])
var _cur_task_start =MAX('Table'[StartDate])
var _cur_task_end = MAX('Table'[EndDate])
var _days =VALUE(FORMAT( _cur_task_end - _cur_task_start , "0"))
var _cur_year =DATE(YEAR( MAX('Date'[Date])),12,31)
var _cur_year_1 = DATE(YEAR( MAX('Date'[Date])),1,1)
var _days2 = IF(_cur_task_end> _cur_year ,VALUE(FORMAT( _cur_year-_cur_task_start, "0")),_days)
var _end2 = IF(_cur_year<_cur_task_end,_cur_year,_cur_task_end)
var _days3 = VALUE(FORMAT( _end2-_cur_year_1, "0"))
return
IF( _cur_task_start <_cur_year_1 && _cur_task_end >=_cur_year_1 && _start_date=_cur_year_1 , _days3,IF(_start_date=_cur_task_start,_days2,BLANK()))

 

 

 

 

 

please check this post to understand the situation better : Solved: Re: Date slicer in Gantt charts - Microsoft Power BI Community

 

2nd- My database only have start anend date, if I'll filter dates in between it will not counted in the output. 

ex. Project C, if i filter year = 2022, is it gonna be counted in the final output?

 

Now- I sucseed creating the Gantt chart as desired (the timeline view), which is 50% of my dashboard.

I'm stuck in the remaining 50% - the statistical view.

 

Please, any idea how this issue can be solved?

 

Thank you in advance 🙂