<?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: How to give a value to different rows when condition applies on one only in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2976761#M99682</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="483781" data-lia-user-login="IIPowerBlog" class="lia-mention lia-mention-user"&gt;IIPowerBlog&lt;/a&gt;, thank you for your answer!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried that but I'm only able to get a 1 on the row that has the date, and not on the other row that "A" appears. I need to have the value on both to be able to filter it later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Dec 2022 13:56:00 GMT</pubDate>
    <dc:creator>hasier</dc:creator>
    <dc:date>2022-12-19T13:56:00Z</dc:date>
    <item>
      <title>How to give a value to different rows when condition applies on one only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2976586#M99672</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm facing a problem that I believe should be easy to solve but I don't know which DAX formula to use, the data I have is the following:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;What I need to do is to create a column called "inside" that will have a 1 if the today date (2/5/2023 in the example above) is between the Start and End dates for the Phase "open". The problem is that I need to apply that same value for different rows that have the same Name, so the second time "A" appears on the table should also have a 1 on the "Inside" column. Should it be done with Calculate or a Filter?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then I also need to get the Name of the nearest End date for those projects that have a 1 on Inside, so if for example there would be more projects with a 1, I would need to know which one is more near to the today's date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much in advance for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2022 08:55:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2976586#M99672</guid>
      <dc:creator>hasier</dc:creator>
      <dc:date>2022-12-27T08:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to give a value to different rows when condition applies on one only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2976695#M99675</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="455984" data-lia-user-login="hasier" class="lia-mention lia-mention-user"&gt;hasier&lt;/a&gt;&amp;nbsp; I would create the if clause on a calculated column in the data model. In this way you will have a 1 or a 0 per row. (1)&lt;/P&gt;&lt;P&gt;Then I would create a measure or a calculated column (you will have to see what suits you best) with MAX date to get the latest date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 13:34:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2976695#M99675</guid>
      <dc:creator>IIPowerBlog</dc:creator>
      <dc:date>2022-12-19T13:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to give a value to different rows when condition applies on one only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2976761#M99682</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="483781" data-lia-user-login="IIPowerBlog" class="lia-mention lia-mention-user"&gt;IIPowerBlog&lt;/a&gt;, thank you for your answer!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried that but I'm only able to get a 1 on the row that has the date, and not on the other row that "A" appears. I need to have the value on both to be able to filter it later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 13:56:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2976761#M99682</guid>
      <dc:creator>hasier</dc:creator>
      <dc:date>2022-12-19T13:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to give a value to different rows when condition applies on one only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2976784#M99684</link>
      <description>&lt;P&gt;So you want to relate the 1 or 0 to the Name? How do you differnetiate the rows with the same Name?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 14:03:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2976784#M99684</guid>
      <dc:creator>IIPowerBlog</dc:creator>
      <dc:date>2022-12-19T14:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to give a value to different rows when condition applies on one only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2976830#M99685</link>
      <description>&lt;P&gt;Exactly, I want to choose the 1 or 0 based on the column Phase. When the value on that column is "Open" I check if the today's date is between the Start and End. If it is, I want to put a 1 not only on that row but on all the rows that have that same name, that's what I'm not able to do &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 14:17:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2976830#M99685</guid>
      <dc:creator>hasier</dc:creator>
      <dc:date>2022-12-19T14:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to give a value to different rows when condition applies on one only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2976848#M99686</link>
      <description>&lt;P&gt;You will need one more extra column for this. I think you might be able to achieve this with FILTER() =MIN() , check out this post on Microsoft Learn&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/dax/best-practices/dax-avoid-avoid-filter-as-filter-argument" target="_blank"&gt;https://learn.microsoft.com/en-us/dax/best-practices/dax-avoid-avoid-filter-as-filter-argument&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 14:23:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2976848#M99686</guid>
      <dc:creator>IIPowerBlog</dc:creator>
      <dc:date>2022-12-19T14:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to give a value to different rows when condition applies on one only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2977156#M99702</link>
      <description>&lt;P&gt;That's what I'm not able to do, I have tried both functions and multiple columns but I don't get the result I need &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 17:02:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2977156#M99702</guid>
      <dc:creator>hasier</dc:creator>
      <dc:date>2022-12-19T17:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to give a value to different rows when condition applies on one only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2985879#M100206</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="455984" data-lia-user-login="hasier" class="lia-mention lia-mention-user"&gt;hasier&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created 4 measures to get your expected outputs. Please try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Flag = 
var _today= DATE(2023,5,2)
return IF(_today&amp;gt;=MAX('Table'[START]) &amp;amp;&amp;amp; _today&amp;lt;=MAX('Table'[END]) &amp;amp;&amp;amp; MAX('Table'[Phase])="Open",1,0)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Inside = 
var _flag=SUMX(FILTER(ALL('Table'),[NAME]=MAX('Table'[NAME])),[Flag])
return IF(_flag&amp;gt;=1,1,0)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Diff = 
var _today= DATE(2023,5,2)
var _end=CALCULATE(MAX('Table'[END]),FILTER('Table',[Flag]=1))
return IF(_end=BLANK(),BLANK(), ABS( DATEDIFF(MAX('Table'[END]),_today,DAY)))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Name of Nearest End Date = 
CALCULATE(MAX('Table'[NAME]),FILTER('Table',[Diff]=MINX(ALL('Table'),[Diff])))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Eyelyn Qin&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Accept it as the solution&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 07:40:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-a-value-to-different-rows-when-condition-applies-on/m-p/2985879#M100206</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-23T07:40:02Z</dc:date>
    </item>
  </channel>
</rss>

