<?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 DAX Issue in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Issue/m-p/4852791#M185215</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following DAX (credit &lt;A href="https://addendanalytics.com/blog/calculate-working-hours-in-power-bi" target="_blank" rel="noopener"&gt;https://addendanalytics.com/blog/calculate-working-hours-in-power-bi&lt;/A&gt;) which creates a time from hours and minutes between 06:00 and 23:59 and I want to make a small change:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var Hours_List = SELECTCOLUMNS(GENERATESERIES((6), (23)), “Hour”, [Value])&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var Minutes_List = SELECTCOLUMNS(GENERATESERIES((0), (59)), “Minute”, [Value])&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var two_years_ago_start = DATE(YEAR(NOW())-2,1,1) //DATE(2018,1,1)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var one_year_later_end = DATE(YEAR(NOW())+1,12,31)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var Dates_List = CALENDAR(two_years_ago_start,one_year_later_end)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var HoursandMinutes = ADDCOLUMNS(&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;CROSSJOIN(Hours_List, Minutes_List),&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;“Time”, TIME([Hour], [Minute], 00),&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;“Validity”, IF([Hour]&amp;lt;6 || [Hour]&amp;gt;23,”Non working”,”Working”)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;I would like the list to stop at 23:45 but only for hour 23. I want the window to be 06:00 to 23:45 but still count the last 15 minutes in all other hours. My instinct is to use an IF on the ADDCOLUMNS function used in setting the variable HoursandMinutes but I'm not sure exactly what it would look like as I am used to managing these changes in SQL where I would say:&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;WHERE NOT (Hours_List = 23 AND Minutes_List &amp;gt; 44)&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help would be wonderful&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Matt&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 17 Oct 2025 10:40:34 GMT</pubDate>
    <dc:creator>Matt_dev</dc:creator>
    <dc:date>2025-10-17T10:40:34Z</dc:date>
    <item>
      <title>DAX Issue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Issue/m-p/4852791#M185215</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following DAX (credit &lt;A href="https://addendanalytics.com/blog/calculate-working-hours-in-power-bi" target="_blank" rel="noopener"&gt;https://addendanalytics.com/blog/calculate-working-hours-in-power-bi&lt;/A&gt;) which creates a time from hours and minutes between 06:00 and 23:59 and I want to make a small change:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var Hours_List = SELECTCOLUMNS(GENERATESERIES((6), (23)), “Hour”, [Value])&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var Minutes_List = SELECTCOLUMNS(GENERATESERIES((0), (59)), “Minute”, [Value])&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var two_years_ago_start = DATE(YEAR(NOW())-2,1,1) //DATE(2018,1,1)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var one_year_later_end = DATE(YEAR(NOW())+1,12,31)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var Dates_List = CALENDAR(two_years_ago_start,one_year_later_end)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var HoursandMinutes = ADDCOLUMNS(&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;CROSSJOIN(Hours_List, Minutes_List),&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;“Time”, TIME([Hour], [Minute], 00),&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;“Validity”, IF([Hour]&amp;lt;6 || [Hour]&amp;gt;23,”Non working”,”Working”)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;I would like the list to stop at 23:45 but only for hour 23. I want the window to be 06:00 to 23:45 but still count the last 15 minutes in all other hours. My instinct is to use an IF on the ADDCOLUMNS function used in setting the variable HoursandMinutes but I'm not sure exactly what it would look like as I am used to managing these changes in SQL where I would say:&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;WHERE NOT (Hours_List = 23 AND Minutes_List &amp;gt; 44)&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help would be wonderful&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Matt&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 17 Oct 2025 10:40:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Issue/m-p/4852791#M185215</guid>
      <dc:creator>Matt_dev</dc:creator>
      <dc:date>2025-10-17T10:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Issue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Issue/m-p/4853320#M185219</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just add a filter function to the HoursandMinutes something similar to this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=""&gt;&lt;CODE&gt;Hour minutes tables = var Hours_List = SELECTCOLUMNS(GENERATESERIES((6), (23)), "Hour", [Value])

var Minutes_List =  SELECTCOLUMNS(GENERATESERIES((0), (59)), "Minute", [Value])

var two_years_ago_start = DATE(YEAR(NOW())-2,1,1) //DATE(2018,1,1)

var one_year_later_end = DATE(YEAR(NOW())+1,12,31)

var Dates_List = CALENDAR(two_years_ago_start,one_year_later_end)

var HoursandMinutes = ADDCOLUMNS(

CROSSJOIN(Hours_List, Minutes_List),

"Time", TIME([Hour], [Minute], 00),

"Validity", IF([Hour]&amp;lt;6 || [Hour]&amp;gt;23,"Non working","Working")

)

VAR HourMinutes_23_45 = FILTER( HoursandMinutes, [Time] &amp;lt;= TIME(23,45,00))
RETURN
HourMinutes_23_45&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See in the filter below that for 23 you only get untilm 23:45 for the rest of the hours you have until minute 59&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1276568" data-lia-user-login="Matt_dev" class="lia-mention lia-mention-user"&gt;Matt_dev&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Oct 2025 15:27:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Issue/m-p/4853320#M185219</guid>
      <dc:creator>MFelix</dc:creator>
      <dc:date>2025-10-18T15:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Issue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Issue/m-p/4853779#M185223</link>
      <description>&lt;P&gt;Thank you Miguel, that has worked perfectly&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Oct 2025 07:10:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Issue/m-p/4853779#M185223</guid>
      <dc:creator>Matt_dev</dc:creator>
      <dc:date>2025-10-20T07:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Issue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Issue/m-p/4853818#M185224</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1276568" data-lia-user-login="Matt_dev" class="lia-mention lia-mention-user"&gt;Matt_dev&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't forget to accept the correct answer so it can help out others.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Oct 2025 07:58:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Issue/m-p/4853818#M185224</guid>
      <dc:creator>MFelix</dc:creator>
      <dc:date>2025-10-20T07:58:10Z</dc:date>
    </item>
  </channel>
</rss>

