<?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: Date Difference of two column out of one column might having blank values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084447#M107693</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;Please try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;NewCalculatedColumn =
IF (
    Query1[ResolvedDate] = BLANK (),
    "Open",
    DATEDIFF ( Query1[StartDate], Query1[ResolvedDate], DAY ) &amp;amp; " day(s)"
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Feb 2023 06:01:47 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-02-17T06:01:47Z</dc:date>
    <item>
      <title>Date Difference of two column out of one column might having blank values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3083436#M107605</link>
      <description>&lt;P class="lia-align-justify"&gt;Hello Everyone,&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;Your help will be appreciated for sure. I have two columns (CreatedDate and ResolvedDate) and I want to generate new column having difference of days of columns (CreatedDate and ResolvedDate). Some of the cells of ResolvedDate column are blank for that it should consider today's (Current) date.&lt;/P&gt;&lt;P class="lia-align-justify"&gt;The query is direct query which means it is live with database.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 13:58:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3083436#M107605</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-16T13:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference of two column out of one column might having blank values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3083547#M107622</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since your data is live I would expect that the max date in either of the columns is today or worst case yesterday. Is that the case?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 15:11:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3083547#M107622</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-16T15:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference of two column out of one column might having blank values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3083578#M107626</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp; Yes. Created date will be there in every cell which will be minimum but in resolved date (max date), some cells will be blank beacuse my some of cases are still active. So, in place of blank cell it should consider today's date (date on which person is seeing the power bi report) and in difference column (which I want to generate) there should be difference in days of both column (resolved date - created date)&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 15:27:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3083578#M107626</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-16T15:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference of two column out of one column might having blank values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3083667#M107634</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure about how your data are displayed but could it be something like :&lt;/P&gt;
&lt;P&gt;Mesure =&amp;nbsp;&lt;BR /&gt;VAR ResDate = IF ( ISNULL([ResolvedDate]) , today() , [ResolvedDate])&lt;BR /&gt;RETURN&lt;BR /&gt;DATEDIFF( [StartDate] , ResDate , xxx)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps,&lt;/P&gt;
&lt;P&gt;otherwise do not hesitate to provide sample datas without sensitive information...&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 16:14:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3083667#M107634</guid>
      <dc:creator>AilleryO</dc:creator>
      <dc:date>2023-02-16T16:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference of two column out of one column might having blank values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084409#M107688</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="120362" data-lia-user-login="AilleryO" class="lia-mention lia-mention-user"&gt;AilleryO&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this will make you clear, Please create query for this table. CreatedDate and ResolvedDate column is already there I have to calculate ResolutionTime column.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 04:43:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084409#M107688</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-17T04:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference of two column out of one column might having blank values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084419#M107690</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Let me explain further.&lt;BR /&gt;In normal cases it is just simple to return TODAY ( ) instead of a blank while creating a new calculated column. But using TODAY ( ) and NOW ( ) functions to create calculated columns is not allowed when the connection is Direct Query.&lt;/P&gt;
&lt;P&gt;What I was thinking is if the maximum date value in either the &lt;SPAN&gt;CreatedDate&amp;nbsp;or the&amp;nbsp;ResolvedDate columns is actually the date of today, then we can easily retrieve that value and return it in case the&amp;nbsp;ResolvedDate is blank.&amp;nbsp;&lt;BR /&gt;So in normal cases I would use&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;NewCalculatedColumn =
DATEDIFF (
    Query1[StartDate],
    COALESCE ( Query1[ResolvedDate], TODAY () ),
    DAY
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but since TODAY ( ) won't work in a calculated column created with a direct query connection you may try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;NewCalculatedColumn =
DATEDIFF (
    Query1[StartDate],
    COALESCE ( Query1[ResolvedDate], MAX ( Query1[ResolvedDate] ) ),
    DAY
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 05:13:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084419#M107690</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-17T05:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference of two column out of one column might having blank values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084432#M107692</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Yes, I thought same that it will not work in case of Direct Query. However, I can replace Today's date in blank cell to string "Open"&lt;BR /&gt;So, if resolved date is blank then it should throw as "Open " in calculated column.&lt;/P&gt;&lt;P&gt;Please consider this one if it works for you Or else give me other suggestion for resolved date having blank cells.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 05:37:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084432#M107692</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-17T05:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference of two column out of one column might having blank values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084447#M107693</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;NewCalculatedColumn =
IF (
    Query1[ResolvedDate] = BLANK (),
    "Open",
    DATEDIFF ( Query1[StartDate], Query1[ResolvedDate], DAY ) &amp;amp; " day(s)"
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 06:01:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084447#M107693</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-17T06:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference of two column out of one column might having blank values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084513#M107699</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;If I check the column&amp;nbsp; "NewCalculatedColumn" then it is throwing error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I had created custom column with below query in power query&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;and getting result but not as expected. For blank resolve cells, I want word as "Open" OR if it will consider today's date then I should get result in whole numbers as expected.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 07:08:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084513#M107699</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-17T07:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference of two column out of one column might having blank values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084537#M107702</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;So you want to sum the days in a measure. In this case there in no need to create a calculated column, we can directly create a measure as follows&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;NewMeasure =
COALESCE (
    SUMX (
        Query1,
        IF (
            Query1[ResolvedDate] &amp;lt;&amp;gt; BLANK (),
            DATEDIFF ( Query1[StartDate], Query1[ResolvedDate], DAY )
        )
    ),
    "OPEN"
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 17 Feb 2023 07:19:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084537#M107702</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-17T07:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference of two column out of one column might having blank values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084587#M107708</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I check this getting below error. I added query by selecting New Measure option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 07:57:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084587#M107708</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-17T07:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference of two column out of one column might having blank values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084605#M107712</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I hate direct query. Please try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;NewMeasure =
COALESCE (
    SUMX (
        Query1,
        IF (
            Query1[ResolvedDate] &amp;lt;&amp;gt; BLANK (),
            INT ( Query1[ResolvedDate] - Query1[StartDate] )
        )
    ),
    "OPEN"
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 08:08:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084605#M107712</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-17T08:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference of two column out of one column might having blank values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084653#M107713</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Same result as previous.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 08:47:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084653#M107713</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-17T08:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference of two column out of one column might having blank values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084693#M107718</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I guess DateTime operations over a columns from a direct query connection are not allowed. That will bring us back to Power Query&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;= Table.AddColumn(Source, 'IMC Age", each if [ResolveDate]= "" then null else [ResolveDate]-[CreateDate])&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;NewMeasure =
COALESCE ( SUM ( Query1[IMC Age] ), "OPEN" )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 09:12:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3084693#M107718</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-17T09:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference of two column out of one column might having blank values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3085239#M107784</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you for your valuable time. Unfortunately, none of query worked but I got result after changing it to KUSTO query directly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your quick responses.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 14:56:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Difference-of-two-column-out-of-one-column-might-having/m-p/3085239#M107784</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-17T14:56:50Z</dc:date>
    </item>
  </channel>
</rss>

