<?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: Number of days between yesterday and due date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-days-between-yesterday-and-due-date/m-p/3312522#M123885</link>
    <description>&lt;P&gt;Hi Mahesh, thanks for the swift response, unfortunately your suggestion gave issues as well. We are trying now "&lt;SPAN&gt;&lt;SPAN class=""&gt;SWITCH(TRUE(), ISBLANK([DueDate]) || ISBLANK(TODAY()-1), 0, TRUE(), DATEDIFF([DueDate], TODAY()-1, DAY))"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;the CurrentDate which is in fact GetDate()-1 seems to be the problem....&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jul 2023 11:13:46 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-07-03T11:13:46Z</dc:date>
    <item>
      <title>Number of days between yesterday and due date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-days-between-yesterday-and-due-date/m-p/3311966#M123846</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;Am using MS Analysis Server and need to calculate the number of days between yesterday and the due date. For yesterday i used the GetDate()-1 formula and i get a date like 2023-01-01 00:00:00:000 the due date looks similar. My script that calculates the number of days looks like this:&lt;/P&gt;&lt;P&gt;CASE WHEN TRY_CONVERT(DATE, CONVERT(VARCHAR(8), [DueDate]), 112) IS NULL OR TRY_CONVERT(DATE,CONVERT(VARCHAR(8), [CurrentDate]), 112) IS NULL&lt;/P&gt;&lt;P&gt;THEN 0&lt;/P&gt;&lt;P&gt;ELSE DATEDIFF(dd, TRY_CONVERT(DATE, CONVERT(VARCHAR(8), [DueDate]),112, TRY_CONVERT(DATE, CONVERT(VARCHAR(8), [CurrentDate],112))&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;now, the script is not working and gives an error message. Tried a lot of alternatives but nothing worked so far.&lt;/P&gt;&lt;P&gt;Anyone an idea what needs to be done???&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 05:32:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-days-between-yesterday-and-due-date/m-p/3311966#M123846</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-03T05:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Number of days between yesterday and due date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-days-between-yesterday-and-due-date/m-p/3311991#M123848</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Please Try below script&lt;BR /&gt;CASE WHEN CONVERT(DATE,CONVERT(VARCHAR(20), [DueDate], 109),112) IS NULL OR CONVERT(DATE,CONVERT(VARCHAR(20), [CurrentDate], 109),112) IS NULL&lt;/P&gt;&lt;P&gt;THEN 0&lt;/P&gt;&lt;P&gt;ELSE DATEDIFF(dd, CONVERT(DATE,CONVERT(VARCHAR(20), [DueDate], 109),112), CONVERT(DATE,CONVERT(VARCHAR(20), [CurrentDate], 109),112))&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 05:55:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-days-between-yesterday-and-due-date/m-p/3311991#M123848</guid>
      <dc:creator>Mahesh0016</dc:creator>
      <dc:date>2023-07-03T05:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Number of days between yesterday and due date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-days-between-yesterday-and-due-date/m-p/3312522#M123885</link>
      <description>&lt;P&gt;Hi Mahesh, thanks for the swift response, unfortunately your suggestion gave issues as well. We are trying now "&lt;SPAN&gt;&lt;SPAN class=""&gt;SWITCH(TRUE(), ISBLANK([DueDate]) || ISBLANK(TODAY()-1), 0, TRUE(), DATEDIFF([DueDate], TODAY()-1, DAY))"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;the CurrentDate which is in fact GetDate()-1 seems to be the problem....&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 11:13:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-days-between-yesterday-and-due-date/m-p/3312522#M123885</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-03T11:13:46Z</dc:date>
    </item>
  </channel>
</rss>

