<?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 a shift model in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-shift-model/m-p/875323#M7329</link>
    <description>&lt;P&gt;My Data looks like this (each row is a user):&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Conditional Column looks like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is ok but I need to adjust the weekly change from the early and late shift group.&lt;/P&gt;</description>
    <pubDate>Sat, 14 Dec 2019 09:21:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-12-14T09:21:15Z</dc:date>
    <item>
      <title>Creating a shift model</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-shift-model/m-p/872527#M7250</link>
      <description>&lt;P&gt;I analyse user numbers, and I would like to divide the work day into early (6 am- 2 pm), &amp;nbsp;late (2 pm- 10 pm) and night shifts (10 pm- 6 am). Creating the night shift is no problem because it runs every weekday from 10pm - 6 am. IIt is difficult for me to create the early and late shift, because they change every week. In calendar week 48 group A has the early shift (6 am- 14 pm) and group B the late shift (2 pm- 10 pm). In calendar week 49 group B has the early shift and group A the late shift and so on.&lt;/P&gt;&lt;P&gt;I would be very grateful for helpful tips!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 20:29:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-shift-model/m-p/872527#M7250</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-11T20:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a shift model</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-shift-model/m-p/872614#M7254</link>
      <description>&lt;P&gt;Please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hard to be specific without source data. But, if you created an hours table like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;R06_Table = 
VAR __Hours = 
        SELECTCOLUMNS(
            GENERATESERIES(1 , 12 , 1),
            "Hour",
            [Value] &amp;amp; ":00:00 "
        )
VAR __Period = 
    SELECTCOLUMNS(
        { ("AM"),("PM") },
        "AM/PM",
        [Value]
    )
VAR __HoursAMPM = GENERATEALL(__Hours, __Period)
VAR __Final = 
    SELECTCOLUMNS(
        ADDCOLUMNS(
            __HoursAMPM,
            "Time",
            TIMEVALUE([Hour] &amp;amp; [AM/PM])
        ),
        "Time",
        CONVERT(TODAY() &amp;amp; " " &amp;amp; [Time], DATETIME)
    )
RETURN
    __Final&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could create a Shift column like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Shift = 
VAR __1stBegin = 9
VAR __2ndBegin = 17
VAR __3rdBegin = 1
VAR __Time = TIMEVALUE('R06_Table'[Time])
VAR __Hour = HOUR(__Time)
RETURN
SWITCH(TRUE(),
    __Hour &amp;gt;= __1stBegin &amp;amp;&amp;amp; __Hour &amp;lt; __2ndBegin,"First",
    __Hour &amp;gt;= __2ndBegin || __Hour &amp;lt; __3rdBegin,"Second",
    "Third"
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 21:47:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-shift-model/m-p/872614#M7254</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2019-12-11T21:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a shift model</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-shift-model/m-p/875323#M7329</link>
      <description>&lt;P&gt;My Data looks like this (each row is a user):&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Conditional Column looks like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is ok but I need to adjust the weekly change from the early and late shift group.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Dec 2019 09:21:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-shift-model/m-p/875323#M7329</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-14T09:21:15Z</dc:date>
    </item>
  </channel>
</rss>

