<?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 Variable wrong format in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Variable-wrong-format/m-p/2064483#M46640</link>
    <description>&lt;P&gt;I think I have to pologize, I work in Power Pivot, normally Power BI. And I now realize that these measure doesent act the same. All answers is probably correct. But in Power Pivot it fails when I put -7 in the formula.&lt;/P&gt;&lt;P&gt;If I skip -7 it shows me a results, but I can not find a way to offset my enddate.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Sep 2021 14:14:29 GMT</pubDate>
    <dc:creator>Stabben23</dc:creator>
    <dc:date>2021-09-08T14:14:29Z</dc:date>
    <item>
      <title>Date Variable wrong format</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Variable-wrong-format/m-p/2064295#M46632</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a variable in my DAX formula.&lt;/P&gt;&lt;P&gt;Var = maxdate= max(DateTable[Date])-7, this should gives me the maxdate from selected slicer in YYYY-MM-DD format but it gives me a numeric value for the date. So when I try to filter DateTable &amp;lt;= maxdate it doesent filter.&lt;/P&gt;&lt;P&gt;If I define the Variable like Date(2021-09-01) everything works fine.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 12:52:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Variable-wrong-format/m-p/2064295#M46632</guid>
      <dc:creator>Stabben23</dc:creator>
      <dc:date>2021-09-08T12:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Date Variable wrong format</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Variable-wrong-format/m-p/2064437#M46638</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="122756" data-lia-user-login="Stabben23" class="lia-mention lia-mention-user"&gt;Stabben23&lt;/a&gt;&amp;nbsp;That's odd. I can't replicate that behavior with a date table with a Date column.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 13:53:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Variable-wrong-format/m-p/2064437#M46638</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-08T13:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Date Variable wrong format</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Variable-wrong-format/m-p/2064447#M46639</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="122756" data-lia-user-login="Stabben23" class="lia-mention lia-mention-user"&gt;Stabben23&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try below code:-&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure =
VAR selected_date =
    SELECTEDVALUE ( table[date] )
VAR maxx_date =
    DATEVALUE ( FORMAT ( selected_date - 7, "YYYY-MM-DD" ) )
RETURN
    maxx_date&lt;/LI-CODE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Samarth&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 13:58:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Variable-wrong-format/m-p/2064447#M46639</guid>
      <dc:creator>Samarth_18</dc:creator>
      <dc:date>2021-09-08T13:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Date Variable wrong format</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Variable-wrong-format/m-p/2064483#M46640</link>
      <description>&lt;P&gt;I think I have to pologize, I work in Power Pivot, normally Power BI. And I now realize that these measure doesent act the same. All answers is probably correct. But in Power Pivot it fails when I put -7 in the formula.&lt;/P&gt;&lt;P&gt;If I skip -7 it shows me a results, but I can not find a way to offset my enddate.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 14:14:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Variable-wrong-format/m-p/2064483#M46640</guid>
      <dc:creator>Stabben23</dc:creator>
      <dc:date>2021-09-08T14:14:29Z</dc:date>
    </item>
  </channel>
</rss>

