Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Razaning
Frequent Visitor

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 🙂

1 REPLY 1
amitchandak
Super User
Super User

@Razaning , Do you need the open project?

refer the formula

Matrix as Project plan Visual: https://youtu.be/R25QoiyoSVs

 

Or the files attached

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.