<?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 Dax Measures in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measures/m-p/1952273#M42577</link>
    <description>&lt;P&gt;I am trying to write a dax measures for finding the number of dates between two dates in column A &amp;amp; B....... I do not want to add a calculated column but a dax measures that will perform the difference. I am using DATEDIFF but I cannot select the columns where the dates are I am assuming I need to use an aggregator or something, like calculate, max, min etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column A = 06/20/2021&lt;/P&gt;&lt;P&gt;Column B = 05/24/2021&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jul 2021 12:53:50 GMT</pubDate>
    <dc:creator>peteru9067</dc:creator>
    <dc:date>2021-07-12T12:53:50Z</dc:date>
    <item>
      <title>Dax Measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measures/m-p/1952273#M42577</link>
      <description>&lt;P&gt;I am trying to write a dax measures for finding the number of dates between two dates in column A &amp;amp; B....... I do not want to add a calculated column but a dax measures that will perform the difference. I am using DATEDIFF but I cannot select the columns where the dates are I am assuming I need to use an aggregator or something, like calculate, max, min etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column A = 06/20/2021&lt;/P&gt;&lt;P&gt;Column B = 05/24/2021&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 12:53:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measures/m-p/1952273#M42577</guid>
      <dc:creator>peteru9067</dc:creator>
      <dc:date>2021-07-12T12:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measures/m-p/1952396#M42582</link>
      <description>&lt;P&gt;You can try below code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;Date_Diff = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var calculate_diff = DATEDIFF(MAX('Dates_table'[Column A]),MAX('Dates_table'[Column B]),DAY)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return IF(calculate_diff &amp;lt; 0,calculate_diff * -1,calculate_diff)&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;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Jul 2021 13:42:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measures/m-p/1952396#M42582</guid>
      <dc:creator>Samarth_18</dc:creator>
      <dc:date>2021-07-12T13:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measures/m-p/1952450#M42585</link>
      <description>&lt;P&gt;Thank you very much........ that worked perfectly well for me.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 14:19:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measures/m-p/1952450#M42585</guid>
      <dc:creator>peteru9067</dc:creator>
      <dc:date>2021-07-12T14:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measures/m-p/1952484#M42590</link>
      <description>&lt;P&gt;An extension to what I am actually trying to accomplish is calculating overdue dates for Compliance Testing. I can use calculated columns to get it done but I know there is probably a better way to use measures.&lt;/P&gt;&lt;P&gt;So with both columns Column A is Planned Date and Column B is Completed Date...... in my fact table if the test is yet to be performed column B is 12/31/1899. So if Planned date was 07/01/2021 and completed is 12/31/1899 that means the test is "overdue" by 11 days if counting today.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So here is what I think the code should be:&lt;/P&gt;&lt;P&gt;IF Column A &amp;lt;= today() &amp;amp;&amp;amp; Column B = 12/31/1899, **some planned dates are in the future&lt;/P&gt;&lt;P&gt;Datediff = Column A, Column B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But what will the DAX Measure look like&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 14:40:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measures/m-p/1952484#M42590</guid>
      <dc:creator>peteru9067</dc:creator>
      <dc:date>2021-07-12T14:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measures/m-p/1952675#M42598</link>
      <description>&lt;P&gt;You can create measure with below code to achive this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Date_Differences = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR calculate_diff =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DATEDIFF ( MAX ( 'Test'[Column A] ), TODAY(), DAY )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MAX ( 'Test'[Column A] ) &amp;lt;= TODAY ()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;amp;&amp;amp; MAX ( 'Test'[Column B] ) = DATE ( 1899, 12, 31 ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;calculate_diff,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FORMAT ( MAX ( 'Test'[Column B] ), "MM/DD/YYYY" )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;PFA screenshot of output&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Jul 2021 16:20:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measures/m-p/1952675#M42598</guid>
      <dc:creator>Samarth_18</dc:creator>
      <dc:date>2021-07-12T16:20:24Z</dc:date>
    </item>
  </channel>
</rss>

