<?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 between 2 previous months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-difference-between-2-previous-months/m-p/3107516#M109629</link>
    <description>&lt;P&gt;Some more info, my measure looks like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Datediff =

CALCULATE(
if(
    SELECTEDVALUE('Date'[MonthEndDate]) &amp;gt;= SELECTEDVALUE(Sales[PurchasedDate]) ,
    DATEDIFF(SELECTEDVALUE(Sales[PurchasedDate]), SELECTEDVALUE('Date'[MonthEndDate]) , DAY),
    "f"
), USERELATIONSHIP(Sales[PurchasedDate], 'Date'[Date]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;And I get this result:&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It only calculates the datediff to the month itself.&amp;nbsp;&lt;BR /&gt;I want the difference to all following month ends.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Mar 2023 09:58:38 GMT</pubDate>
    <dc:creator>kav_cris</dc:creator>
    <dc:date>2023-03-02T09:58:38Z</dc:date>
    <item>
      <title>Date difference between 2 previous months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-difference-between-2-previous-months/m-p/3087781#M108030</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate the storage time (in days) for unsold items, historically.&lt;/P&gt;&lt;P&gt;Let's say I bought product A in Jan 2022 and it is still stored today.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATEDIFF(&lt;SPAN&gt;Sales[PurchaseDate], &lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;(), DAY),&lt;/SPAN&gt;) gives me the storage time in days up until today.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want a bar chart that shows storage time in Feb 2022, March 2022, ... Feb 2023.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried replacing TODAY() with MAX(Date[Date]) or SELECTEDVALUE(Date[Date]) with no success.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;P.S. Sales table only has PurchaseDate adn SoldDate as date columns.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 11:33:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-difference-between-2-previous-months/m-p/3087781#M108030</guid>
      <dc:creator>kav_cris</dc:creator>
      <dc:date>2023-02-20T11:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference between 2 previous months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-difference-between-2-previous-months/m-p/3087979#M108040</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="510883" data-lia-user-login="kav_cris" class="lia-mention lia-mention-user"&gt;kav_cris&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try to provide sample dataset with expected result.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 13:09:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-difference-between-2-previous-months/m-p/3087979#M108040</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-02-20T13:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference between 2 previous months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-difference-between-2-previous-months/m-p/3107516#M109629</link>
      <description>&lt;P&gt;Some more info, my measure looks like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Datediff =

CALCULATE(
if(
    SELECTEDVALUE('Date'[MonthEndDate]) &amp;gt;= SELECTEDVALUE(Sales[PurchasedDate]) ,
    DATEDIFF(SELECTEDVALUE(Sales[PurchasedDate]), SELECTEDVALUE('Date'[MonthEndDate]) , DAY),
    "f"
), USERELATIONSHIP(Sales[PurchasedDate], 'Date'[Date]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;And I get this result:&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It only calculates the datediff to the month itself.&amp;nbsp;&lt;BR /&gt;I want the difference to all following month ends.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 09:58:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-difference-between-2-previous-months/m-p/3107516#M109629</guid>
      <dc:creator>kav_cris</dc:creator>
      <dc:date>2023-03-02T09:58:38Z</dc:date>
    </item>
  </channel>
</rss>

