<?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: Populate a date field based on a criteria in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populate-a-date-field-based-on-a-criteria/m-p/3504933#M134460</link>
    <description>&lt;P&gt;Please provide sample data (with sensitive information removed) 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). Leave out anything not related to the issue. &lt;BR /&gt;If you are unsure how to do that please refer to &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;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;If you want to get answers faster please refer to &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>Mon, 30 Oct 2023 15:05:34 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2023-10-30T15:05:34Z</dc:date>
    <item>
      <title>Populate a date field based on a criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populate-a-date-field-based-on-a-criteria/m-p/3501596#M134291</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a bit of a dilema regarding creation of a new date field based on two otehr date fields values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example - If i have an item with a billing date set to 30th September 2023 and alos has a billing entered date set to the 1st or 2nd day for October I need the allocation date to be set to the billing date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the billing date is 30th September and the billing entered date is 20th September, then the allocated date should be the 30th Sept&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However if the billing date is the 30th September 2023 and the billing entered date is 4th October 2023 then the allocated date should be 4th October.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically ther are 2 days at the beginning of each month whereby billing entered dates can be added for itmes with billing dates in the&amp;nbsp; previous month&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Billing date&lt;/TD&gt;&lt;TD&gt;Billing entered date&lt;/TD&gt;&lt;TD&gt;Allocation date (non calculated value)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;28/10/2023&lt;/TD&gt;&lt;TD&gt;01/11/2023&lt;/TD&gt;&lt;TD&gt;28/10/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;28/10/2023&lt;/TD&gt;&lt;TD&gt;02/11/2023&lt;/TD&gt;&lt;TD&gt;28/10/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30/09/2023&lt;/TD&gt;&lt;TD&gt;20/09/2023&lt;/TD&gt;&lt;TD&gt;30/09/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;29/09/2023&lt;/TD&gt;&lt;TD&gt;04/10/2023&lt;/TD&gt;&lt;TD&gt;04/10/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01/02/2023&lt;/TD&gt;&lt;TD&gt;02/02/2023&lt;/TD&gt;&lt;TD&gt;01/02/2023&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 27 Oct 2023 14:41:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populate-a-date-field-based-on-a-criteria/m-p/3501596#M134291</guid>
      <dc:creator>James_Ma</dc:creator>
      <dc:date>2023-10-27T14:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Populate a date field based on a criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populate-a-date-field-based-on-a-criteria/m-p/3502871#M134339</link>
      <description>&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrLQNzTQNzIwMlbSUTIw1Dc0hHBiddDljFDkjA30DSxhckYIDlifJZKcgQncEJAc0AqgSQgzYZzYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Billing date" = _t, #"Billing entered date" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Billing date", type date}, {"Billing entered date", type date}},"en-GB"),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Allocation date", each if List.Contains({1,2},Date.Day([Billing entered date])) then [Billing date] else List.Max({[Billing date],[Billing entered date]}))
in
    #"Added Custom"&lt;/LI-CODE&gt;
&lt;P&gt;How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2023 21:14:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populate-a-date-field-based-on-a-criteria/m-p/3502871#M134339</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-10-28T21:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Populate a date field based on a criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populate-a-date-field-based-on-a-criteria/m-p/3504763#M134454</link>
      <description>&lt;P&gt;Thanks for this, the problem is that the data&amp;nbsp; I gave are just for a a demo purpose, not the actual data table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 13:58:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populate-a-date-field-based-on-a-criteria/m-p/3504763#M134454</guid>
      <dc:creator>James_Ma</dc:creator>
      <dc:date>2023-10-30T13:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Populate a date field based on a criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populate-a-date-field-based-on-a-criteria/m-p/3504933#M134460</link>
      <description>&lt;P&gt;Please provide sample data (with sensitive information removed) 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). Leave out anything not related to the issue. &lt;BR /&gt;If you are unsure how to do that please refer to &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;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;If you want to get answers faster please refer to &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>Mon, 30 Oct 2023 15:05:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populate-a-date-field-based-on-a-criteria/m-p/3504933#M134460</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-10-30T15:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Populate a date field based on a criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populate-a-date-field-based-on-a-criteria/m-p/3505041#M134467</link>
      <description>&lt;P&gt;Guess the below is the same as above right?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 15:56:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populate-a-date-field-based-on-a-criteria/m-p/3505041#M134467</guid>
      <dc:creator>James_Ma</dc:creator>
      <dc:date>2023-10-30T15:56:18Z</dc:date>
    </item>
  </channel>
</rss>

