Forum Discussion
Creating Team reports that are date sensitive
- 1 year ago
Hi RichardLBHF1 ,
I generated dummy data to simulate your case. To achieve your requirement, you'll be using a technique similar to the headcount analysis discussed in the link below.
In a nutshell, you only need two tables to achieve your desired output:
- A team table with Team Number, Name, start date, and end date.
- A disconnected calendar table.
Your data model would look like the diagram below, where the two tables remain disconnected.
Next, you would write a measure like the one below:
Team duration = SUMX ( Teams, IF ( Teams[Start Date] <= max('Calendar'[Date]) && Teams[End Date] >= max('Calendar'[Date]), 1, BLANK () ) )In order to create a Gantt-chart-esque visual using the standard matrix visual, I added background color to the measure by writing a measure like the one below:
ColorMeasure = IF( ISBLANK([Team duration]), BLANK(), IF([Team duration] > 0, "#FFC0CB", BLANK()) // Pink for positive numbers, no color for blank cells )The resulting output looks like the one below, where you can filter by fields from both the calendar table and the team table to see the status of the team on any selected dates.
While you can explore a more refined look using a custom Gantt chart visual, the matrix table can also achieve a basic Gantt-chart-like appearance, displaying the project duration and the team members.
I have attached an example pbix file for your reference.
Best regards,
Hi RichardLBHF1 ,
I generated dummy data to simulate your case. To achieve your requirement, you'll be using a technique similar to the headcount analysis discussed in the link below.
In a nutshell, you only need two tables to achieve your desired output:
- A team table with Team Number, Name, start date, and end date.
- A disconnected calendar table.
Your data model would look like the diagram below, where the two tables remain disconnected.
Next, you would write a measure like the one below:
Team duration =
SUMX (
Teams,
IF (
Teams[Start Date] <= max('Calendar'[Date])
&& Teams[End Date] >= max('Calendar'[Date]),
1,
BLANK ()
)
)
In order to create a Gantt-chart-esque visual using the standard matrix visual, I added background color to the measure by writing a measure like the one below:
ColorMeasure =
IF(
ISBLANK([Team duration]),
BLANK(),
IF([Team duration] > 0, "#FFC0CB", BLANK()) // Pink for positive numbers, no color for blank cells
)
The resulting output looks like the one below, where you can filter by fields from both the calendar table and the team table to see the status of the team on any selected dates.
While you can explore a more refined look using a custom Gantt chart visual, the matrix table can also achieve a basic Gantt-chart-like appearance, displaying the project duration and the team members.
I have attached an example pbix file for your reference.
Best regards,
- RichardLBHF11 year agoNew Member
Hi,
Thank you for your reply. Originally I thought I may have been able to use this solution however unfortunately it does not quite work. The reasons are:
1) It does not like realtive dates.
2) If the start date is not before the first date it doesn't pick the person up,
3) If the end date is before the last date of the serch then the person isn't picked up.
Thank you for the effort though