Forum Discussion
Help for Date range slicer only affect the data bars not data.
Hi yuvi12 ,
Try this steps
Insert a Gantt chart visual into your Power BI report.
Drag and drop the project name or ID into the "Values" field well of the Gantt chart visual.
Drag the activity start date and activity end date into the "StartDate" and "EndDate" field wells of the Gantt chart visual.
Click on the Gantt chart visual to select it.
Go to the "Format" pane.
Under the "Filters" section, select the "Filters on this visual" option.
Click on the date column you added to the slicer to create a filter.
Choose the "Between" filter type.
This will filter the Gantt chart based on the selected date range.
To display projects that don't have any activities within the selected date range as empty bars, you'll need to create a measure to calculate the status of each project within the date range.
Go to the "Modeling" tab in Power BI.
Click on "New Measure" and create a DAX measure that checks if any activities for a project fall within the selected date range.
For example:
ProjectStatus =
IF (
MIN(YourActivityTable[StartDate]) >= MIN(DateSlicer[Date]) &&
MAX(YourActivityTable[EndDate]) <= MAX(DateSlicer[Date]),
"In Range",
"Out of Range"
)
Drag and drop the "ProjectStatus" measure you created into the "Values" field well of the Gantt chart visual.
Set the aggregation for this measure to "Don't Summarize."
Let me know id this work, and if not please share a screenshort with the problem.
Thanks
Babatunde Dallas