<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Creating Team reports that are date sensitive in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Team-reports-that-are-date-sensitive/m-p/4239607#M167769</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="796218" data-lia-user-login="RichardLBHF1" class="lia-mention lia-mention-user"&gt;RichardLBHF1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/Dynamic-Headcount-Analysis-using-Dax/ba-p/4164529" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/Dynamic-Headcount-Analysis-using-Dax/ba-p/4164529&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In a nutshell, you only need two tables to achieve your desired output:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;A team table with Team Number, Name, start date, and end date.&lt;/LI&gt;
&lt;LI&gt;A disconnected calendar table.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Your data model would look like the diagram below, where the two tables remain disconnected.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Next, you would write a measure like the one below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Team duration = 
SUMX (
    Teams,
    IF (
        Teams[Start Date] &amp;lt;= max('Calendar'[Date])
            &amp;amp;&amp;amp; Teams[End Date] &amp;gt;= max('Calendar'[Date]),
        1,
        BLANK ()
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;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:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ColorMeasure = 
IF(
    ISBLANK([Team duration]),
    BLANK(),
    IF([Team duration] &amp;gt; 0, "#FFC0CB", BLANK())  // Pink for positive numbers, no color for blank cells
)
&lt;/LI-CODE&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;I have attached an example pbix file for your reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 12 Oct 2024 13:37:11 GMT</pubDate>
    <dc:creator>DataNinja777</dc:creator>
    <dc:date>2024-10-12T13:37:11Z</dc:date>
    <item>
      <title>Creating Team reports that are date sensitive</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Team-reports-that-are-date-sensitive/m-p/4236942#M167587</link>
      <description>&lt;P&gt;I want ot be able to run reports for teams that only pick up stats for when the people are in that team. I have a table for each team. In the table is Team Number, Name, start date and end date. The data that I have in other tables includes names and dates. So in a nutshell if team member 1 was in the team from 1st Sept to Oct 10th and the slicer and the report is set for 1st August to 30th October I only want the data in the team report to count Team member 1's data from the 1st Sept. Any help would&amp;nbsp; be appreciated&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 12:04:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Team-reports-that-are-date-sensitive/m-p/4236942#M167587</guid>
      <dc:creator>RichardLBHF1</dc:creator>
      <dc:date>2024-10-10T12:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Team reports that are date sensitive</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Team-reports-that-are-date-sensitive/m-p/4237431#M167612</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information. Do not include anything that is unrelated to the issue or question. &lt;BR /&gt;&lt;BR /&gt;Need help uploading data? &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 17:44:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Team-reports-that-are-date-sensitive/m-p/4237431#M167612</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-10-10T17:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Team reports that are date sensitive</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Team-reports-that-are-date-sensitive/m-p/4239607#M167769</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="796218" data-lia-user-login="RichardLBHF1" class="lia-mention lia-mention-user"&gt;RichardLBHF1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/Dynamic-Headcount-Analysis-using-Dax/ba-p/4164529" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/Dynamic-Headcount-Analysis-using-Dax/ba-p/4164529&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In a nutshell, you only need two tables to achieve your desired output:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;A team table with Team Number, Name, start date, and end date.&lt;/LI&gt;
&lt;LI&gt;A disconnected calendar table.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Your data model would look like the diagram below, where the two tables remain disconnected.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Next, you would write a measure like the one below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Team duration = 
SUMX (
    Teams,
    IF (
        Teams[Start Date] &amp;lt;= max('Calendar'[Date])
            &amp;amp;&amp;amp; Teams[End Date] &amp;gt;= max('Calendar'[Date]),
        1,
        BLANK ()
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;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:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ColorMeasure = 
IF(
    ISBLANK([Team duration]),
    BLANK(),
    IF([Team duration] &amp;gt; 0, "#FFC0CB", BLANK())  // Pink for positive numbers, no color for blank cells
)
&lt;/LI-CODE&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;I have attached an example pbix file for your reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 13:37:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Team-reports-that-are-date-sensitive/m-p/4239607#M167769</guid>
      <dc:creator>DataNinja777</dc:creator>
      <dc:date>2024-10-12T13:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Team reports that are date sensitive</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Team-reports-that-are-date-sensitive/m-p/4246078#M168104</link>
      <description>&lt;P&gt;&lt;FONT&gt;Thanks for the reply from&amp;nbsp;lbendlin and&amp;nbsp;DataNinja777.&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="796218" data-lia-user-login="RichardLBHF1" class="lia-mention lia-mention-user"&gt;RichardLBHF1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did DataNinja777's reply solve your problem, if so, please mark it as solution. It will be helpful for other members of the community who have similar problems as yours to solve it faster.&amp;nbsp;Thank you very much for your kind cooperation!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Zhu&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 07:35:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Team-reports-that-are-date-sensitive/m-p/4246078#M168104</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-17T07:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Team reports that are date sensitive</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Team-reports-that-are-date-sensitive/m-p/4267091#M169157</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;1) It does not like realtive dates.&lt;/P&gt;&lt;P&gt;2) If the start date is not before the first date it doesn't pick the person up,&lt;/P&gt;&lt;P&gt;3) If the end date is before the last date of the serch then the person isn't picked up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the effort though&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 14:35:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Team-reports-that-are-date-sensitive/m-p/4267091#M169157</guid>
      <dc:creator>RichardLBHF1</dc:creator>
      <dc:date>2024-11-01T14:35:35Z</dc:date>
    </item>
  </channel>
</rss>

