<?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 find closest date after certain date in DAX? (Example shown) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-closest-date-after-certain-date-in-DAX-Example-shown/m-p/2840969#M90786</link>
    <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="421942" data-lia-user-login="whatisdata96" class="lia-mention lia-mention-user"&gt;whatisdata96&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can refer to :&lt;/P&gt;
&lt;P&gt;(1)My test data is the same as yours.&lt;/P&gt;
&lt;P&gt;(2)We can create a calculated column in your table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = var _cuurent_date = 'Table'[Date] 
var _tO =SELECTCOLUMNS( FILTER( 'Table' , 'Table'[Type]= "O") , "Date" , [Date])
var _compare =ADDCOLUMNS( CROSSJOIN( {_cuurent_date} , _tO) , "days" ,ABS( DATEDIFF([Date] ,[Value] ,DAY)))
var _min_days = MINX(_compare, [days])
var _mindate_table = DISTINCT( FILTER( _compare , [days] = _min_days))
return 
IF([Type]="I", CONCATENATEX(_mindate_table,[Date]), BLANK())&lt;/LI-CODE&gt;
&lt;P&gt;(3)Then we can meet your need , the result is as follows:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this method does not meet your needs, you can provide us with your special &lt;STRONG&gt;sample data&lt;/STRONG&gt; and the &lt;STRONG&gt;desired output sample&lt;/STRONG&gt; data in the form of &lt;STRONG&gt;tables&lt;/STRONG&gt;, so that we can better help you solve the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2022 02:05:50 GMT</pubDate>
    <dc:creator>v-yueyunzh-msft</dc:creator>
    <dc:date>2022-10-14T02:05:50Z</dc:date>
    <item>
      <title>How to find closest date after certain date in DAX? (Example shown)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-closest-date-after-certain-date-in-DAX-Example-shown/m-p/2840542#M90763</link>
      <description>&lt;P&gt;Hi all -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking to create a conditional column in Power Query which would analyze 3 columns to output a 'looked up value' (date). This was probably not explained very well. But this is what I want:&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;I'm looking to return the NEXT nearest date for all rows with column 'type' = I. If it says, I, that means we want the next nearest date for where 'type' is O (matching with 'number'. For all rows with 'O' we can leave it as blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to do this via condtional column? Or would I have to do a custom column in Power Query or DAX? Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 20:09:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-closest-date-after-certain-date-in-DAX-Example-shown/m-p/2840542#M90763</guid>
      <dc:creator>whatisdata96</dc:creator>
      <dc:date>2022-10-13T20:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to find closest date after certain date in DAX? (Example shown)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-closest-date-after-certain-date-in-DAX-Example-shown/m-p/2840646#M90764</link>
      <description>&lt;P&gt;HI&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try this measure :&lt;/P&gt;
&lt;P&gt;var daterech=selectedvalue(Table[Date])&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;calculate(Min(Table[Date]),&amp;nbsp;filter(all(Table),&amp;nbsp;Table[Date]&amp;gt;daterech))&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 21:22:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-closest-date-after-certain-date-in-DAX-Example-shown/m-p/2840646#M90764</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-13T21:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to find closest date after certain date in DAX? (Example shown)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-closest-date-after-certain-date-in-DAX-Example-shown/m-p/2840969#M90786</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="421942" data-lia-user-login="whatisdata96" class="lia-mention lia-mention-user"&gt;whatisdata96&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can refer to :&lt;/P&gt;
&lt;P&gt;(1)My test data is the same as yours.&lt;/P&gt;
&lt;P&gt;(2)We can create a calculated column in your table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = var _cuurent_date = 'Table'[Date] 
var _tO =SELECTCOLUMNS( FILTER( 'Table' , 'Table'[Type]= "O") , "Date" , [Date])
var _compare =ADDCOLUMNS( CROSSJOIN( {_cuurent_date} , _tO) , "days" ,ABS( DATEDIFF([Date] ,[Value] ,DAY)))
var _min_days = MINX(_compare, [days])
var _mindate_table = DISTINCT( FILTER( _compare , [days] = _min_days))
return 
IF([Type]="I", CONCATENATEX(_mindate_table,[Date]), BLANK())&lt;/LI-CODE&gt;
&lt;P&gt;(3)Then we can meet your need , the result is as follows:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this method does not meet your needs, you can provide us with your special &lt;STRONG&gt;sample data&lt;/STRONG&gt; and the &lt;STRONG&gt;desired output sample&lt;/STRONG&gt; data in the form of &lt;STRONG&gt;tables&lt;/STRONG&gt;, so that we can better help you solve the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 02:05:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-closest-date-after-certain-date-in-DAX-Example-shown/m-p/2840969#M90786</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2022-10-14T02:05:50Z</dc:date>
    </item>
  </channel>
</rss>

