<?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 Set value for each line of table based on two date fields in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-value-for-each-line-of-table-based-on-two-date-fields/m-p/3185590#M115307</link>
    <description>&lt;P&gt;Hallo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a sales table where the customer id, and contract id is available and i have an contract table with the contract id and the cancelation date. They are connected via the contract id.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition i have an calendar dimension with no connection to the data model where i want to select one day. Therefore i created a slicer and use the minimum date:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I created a measure for the "Select Day": Select Day =&amp;nbsp;&lt;SPAN&gt;min&lt;/SPAN&gt;&lt;SPAN&gt;(Select&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Date&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The dimension looks like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;So the selected value is 01.01.2022.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to do is to use the Select Day date to decicde if a customer is an "active" or "inactive" customer.&lt;/P&gt;&lt;P&gt;If cancelation date is greater or equal than Select Day it is an active customer.&lt;/P&gt;&lt;P&gt;If cancelation date is lower than Select Day it is an inactive customer.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Cancelation date is and status is not used in the report visual, i need the status only for filtering.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;</description>
    <pubDate>Thu, 13 Apr 2023 07:15:37 GMT</pubDate>
    <dc:creator>BE_KMI</dc:creator>
    <dc:date>2023-04-13T07:15:37Z</dc:date>
    <item>
      <title>Set value for each line of table based on two date fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-value-for-each-line-of-table-based-on-two-date-fields/m-p/3185590#M115307</link>
      <description>&lt;P&gt;Hallo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a sales table where the customer id, and contract id is available and i have an contract table with the contract id and the cancelation date. They are connected via the contract id.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition i have an calendar dimension with no connection to the data model where i want to select one day. Therefore i created a slicer and use the minimum date:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I created a measure for the "Select Day": Select Day =&amp;nbsp;&lt;SPAN&gt;min&lt;/SPAN&gt;&lt;SPAN&gt;(Select&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Date&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The dimension looks like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;So the selected value is 01.01.2022.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to do is to use the Select Day date to decicde if a customer is an "active" or "inactive" customer.&lt;/P&gt;&lt;P&gt;If cancelation date is greater or equal than Select Day it is an active customer.&lt;/P&gt;&lt;P&gt;If cancelation date is lower than Select Day it is an inactive customer.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Cancelation date is and status is not used in the report visual, i need the status only for filtering.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 07:15:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-value-for-each-line-of-table-based-on-two-date-fields/m-p/3185590#M115307</guid>
      <dc:creator>BE_KMI</dc:creator>
      <dc:date>2023-04-13T07:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set value for each line of table based on two date fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-value-for-each-line-of-table-based-on-two-date-fields/m-p/3185793#M115324</link>
      <description>&lt;P&gt;Try this measure.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure&amp;nbsp; =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SWITCH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;TRUE&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(Contract Table[Cancellation Date]) &amp;gt;= [select_day],&lt;/SPAN&gt;&lt;SPAN&gt;"Active"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"Inactive"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;if it solve your issue accept my answer as solution&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 13 Apr 2023 08:35:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-value-for-each-line-of-table-based-on-two-date-fields/m-p/3185793#M115324</guid>
      <dc:creator>rautaniket0077</dc:creator>
      <dc:date>2023-04-13T08:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set value for each line of table based on two date fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-value-for-each-line-of-table-based-on-two-date-fields/m-p/3186233#M115359</link>
      <description>&lt;P&gt;Thank you for your answer. For the example it works fine.&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I also tried it at the big data model and there the max cancellation date is wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;As Example: for contract 0200275664 the cancellation date is 25.10.2019:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;But when i use the max function for the cancellation date I get 31.12.9999:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;For all rows in the visual, the cancellation date is 31.12.9999 and therefore all are active.&lt;/P&gt;&lt;P&gt;Do you have an idea why the behaviour is like that?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 12:38:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-value-for-each-line-of-table-based-on-two-date-fields/m-p/3186233#M115359</guid>
      <dc:creator>BE_KMI</dc:creator>
      <dc:date>2023-04-13T12:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set value for each line of table based on two date fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-value-for-each-line-of-table-based-on-two-date-fields/m-p/3189923#M115667</link>
      <description>Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="545249" data-lia-user-login="BE_KMI" class="lia-mention lia-mention-user"&gt;BE_KMI&lt;/a&gt;, please provide the sample pbix file.</description>
      <pubDate>Sun, 16 Apr 2023 08:02:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-value-for-each-line-of-table-based-on-two-date-fields/m-p/3189923#M115667</guid>
      <dc:creator>rautaniket0077</dc:creator>
      <dc:date>2023-04-16T08:02:30Z</dc:date>
    </item>
  </channel>
</rss>

