<?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: Using a Date Parameter in DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Parameter-in-DAX/m-p/4282626#M169964</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="557309" data-lia-user-login="PaisleyPrince" class="lia-mention lia-mention-user"&gt;PaisleyPrince&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try creating a date parameter and use it to dynamically calculate the difference:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Days Difference = 
VAR ChosenDate = SELECTEDVALUE('Selected Date'[Date], TODAY())
RETURN
    DATEDIFF(ChosenDate, MIN('YourTable'[DateColumn]), DAY)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Weeks Difference = 
VAR ChosenDate = SELECTEDVALUE('Selected Date'[Date], TODAY())
RETURN
    DATEDIFF(ChosenDate, MIN('YourTable'[DateColumn]), WEEK)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Months Difference = 
VAR ChosenDate = SELECTEDVALUE('Selected Date'[Date], TODAY())
RETURN
    DATEDIFF(ChosenDate, MIN('YourTable'[DateColumn]), MONTH)
&lt;/LI-CODE&gt;
&lt;P&gt;Hope this helps.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2024 23:14:42 GMT</pubDate>
    <dc:creator>Sahir_Maharaj</dc:creator>
    <dc:date>2024-11-13T23:14:42Z</dc:date>
    <item>
      <title>Using a Date Parameter in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Parameter-in-DAX/m-p/4282558#M169959</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would like to create a scenario where a user chooses a date which is then used to calculate the number of days,weeks and months between the user's chosen date and dates in a table column which are shown in a report.&lt;/P&gt;&lt;P&gt;The parameter should have a default value of today's date.&lt;/P&gt;&lt;P&gt;Would you be able to advise me of the easiest way to do this ?&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 21:44:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Parameter-in-DAX/m-p/4282558#M169959</guid>
      <dc:creator>PaisleyPrince</dc:creator>
      <dc:date>2024-11-13T21:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Date Parameter in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Parameter-in-DAX/m-p/4282626#M169964</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="557309" data-lia-user-login="PaisleyPrince" class="lia-mention lia-mention-user"&gt;PaisleyPrince&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try creating a date parameter and use it to dynamically calculate the difference:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Days Difference = 
VAR ChosenDate = SELECTEDVALUE('Selected Date'[Date], TODAY())
RETURN
    DATEDIFF(ChosenDate, MIN('YourTable'[DateColumn]), DAY)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Weeks Difference = 
VAR ChosenDate = SELECTEDVALUE('Selected Date'[Date], TODAY())
RETURN
    DATEDIFF(ChosenDate, MIN('YourTable'[DateColumn]), WEEK)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Months Difference = 
VAR ChosenDate = SELECTEDVALUE('Selected Date'[Date], TODAY())
RETURN
    DATEDIFF(ChosenDate, MIN('YourTable'[DateColumn]), MONTH)
&lt;/LI-CODE&gt;
&lt;P&gt;Hope this helps.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 23:14:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Parameter-in-DAX/m-p/4282626#M169964</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2024-11-13T23:14:42Z</dc:date>
    </item>
  </channel>
</rss>

