<?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: Value based on the first and last day of the month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3736691#M145655</link>
    <description>&lt;P&gt;Hi&amp;nbsp;@Ibendlin , you are correct, this may be redundant but I plan to use it for other purposes. Thanks for the feedback.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;GK&lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2024 16:16:45 GMT</pubDate>
    <dc:creator>sonshine14916</dc:creator>
    <dc:date>2024-03-01T16:16:45Z</dc:date>
    <item>
      <title>Value based on the first and last day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3734365#M145549</link>
      <description>&lt;P&gt;I have a Dispatch planner table which has the following columns:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want create 2 measures as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Measure-1:&amp;nbsp; Get the OpeningStock based on the first day of the month as a list:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Measure-2: Get the ClosingStock based on the last day of the month as a list:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using the Calculate measure and filters but I'm not getting it in the list format.&lt;/P&gt;&lt;P&gt;Thank you in advance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 17:51:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3734365#M145549</guid>
      <dc:creator>sonshine14916</dc:creator>
      <dc:date>2024-02-29T17:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Value based on the first and last day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3734976#M145569</link>
      <description>&lt;P&gt;Seems a bit redundant unless you have scenarios where the closing stock of the prior month doesn't match the opening stock of the new month?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which measures have you tried?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 01:11:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3734976#M145569</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-01T01:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Value based on the first and last day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3735404#M145597</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="376148" data-lia-user-login="sonshine14916" class="lia-mention lia-mention-user"&gt;sonshine14916&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The Table1 ‘s data is shown below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Please follow these steps:&lt;BR /&gt;1. Use the following DAX expression to create a table named ‘First day of the month’&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;First day of the month = FILTER('Table1','Table1'[Date].[Day] = 1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Use the following DAX expression to create a table named ‘Last day of the mont'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Last day of the month = FILTER(ADDCOLUMNS( VALUES(Table1),"Last day",EOMONTH('Table1'[Date],0)),[Date] = [Last day])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;3. Final output&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;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Wenbin Zhou&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 05:22:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3735404#M145597</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-01T05:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Value based on the first and last day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3735918#M145616</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="376148" data-lia-user-login="sonshine14916" class="lia-mention lia-mention-user"&gt;sonshine14916&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;In your visual, drop the Date column and this measure.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Opening Stock =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_SelDate&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_MthStartDate&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;EOMONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_SelDate&lt;/SPAN&gt;&lt;SPAN&gt;, -&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;) + &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;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SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_SelDate&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;_MthStartDate&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table'&lt;/SPAN&gt;&lt;SPAN&gt;[ClosingStock]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 01 Mar 2024 09:06:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3735918#M145616</guid>
      <dc:creator>talespin</dc:creator>
      <dc:date>2024-03-01T09:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Value based on the first and last day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3736689#M145654</link>
      <description>&lt;P&gt;Hi Wenbin Zhou,&lt;/P&gt;&lt;P&gt;thank you very much for the solution. It works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;GK&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 16:15:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3736689#M145654</guid>
      <dc:creator>sonshine14916</dc:creator>
      <dc:date>2024-03-01T16:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Value based on the first and last day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3736691#M145655</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Ibendlin , you are correct, this may be redundant but I plan to use it for other purposes. Thanks for the feedback.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;GK&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 16:16:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3736691#M145655</guid>
      <dc:creator>sonshine14916</dc:creator>
      <dc:date>2024-03-01T16:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Value based on the first and last day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3736695#M145656</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="678168" data-lia-user-login="talespin" class="lia-mention lia-mention-user"&gt;talespin&lt;/a&gt;&amp;nbsp;, thanks for your inputs. It works as well...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;GK&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 16:19:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3736695#M145656</guid>
      <dc:creator>sonshine14916</dc:creator>
      <dc:date>2024-03-01T16:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Value based on the first and last day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3737388#M145697</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="376148" data-lia-user-login="sonshine14916" class="lia-mention lia-mention-user"&gt;sonshine14916&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're welcome.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Mar 2024 05:11:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-based-on-the-first-and-last-day-of-the-month/m-p/3737388#M145697</guid>
      <dc:creator>talespin</dc:creator>
      <dc:date>2024-03-02T05:11:02Z</dc:date>
    </item>
  </channel>
</rss>

