<?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: Can't make IF work properly when trying to set a default date v a date selected in a slicer.. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-t-make-IF-work-properly-when-trying-to-set-a-default-date-v/m-p/4107709#M163008</link>
    <description>&lt;P&gt;In the picture, scenario 1 has no date selected and you can see in the green SelectedDate shows the date of last data. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; But scenario 2 does have a date selected in the slicer (July 26, 2024) and the FilteredDateCount shows True, so one would expect the SelectedDate to be 2024-07-26.&lt;/P&gt;</description>
    <pubDate>Mon, 19 Aug 2024 21:20:03 GMT</pubDate>
    <dc:creator>DougHoog</dc:creator>
    <dc:date>2024-08-19T21:20:03Z</dc:date>
    <item>
      <title>Can't make IF work properly when trying to set a default date v a date selected in a slicer..</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-t-make-IF-work-properly-when-trying-to-set-a-default-date-v/m-p/4107705#M163006</link>
      <description>&lt;P&gt;I want to drive calculations in DAX based on EITHER the latest transaction date or a date selected by the user in the report with a date slicer. The date table is imported from a data warehouse and is not calculated. I'm not proficient in M and find it more difficult than DAX.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DAX for the latest transaction date works fine:&lt;BR /&gt;LastTransDate =&lt;BR /&gt;VAR __LastTransactionDate = DATEVALUE(MAXX (&amp;nbsp;{MAX ( '_Invoices'[Invoice Date] )}, [Value] ))&lt;BR /&gt;RETURN __LastTransactionDate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have then created a slicer on the report that shows the last 90 days (relative). If the user opens the report and has not selected a date, the calculations would work based on the LastTransDate. But if they want to OVERRIDE the date being used in the MTD, YTD calculations, then they would click a date in the slicer...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I wrote:&amp;nbsp;&lt;/P&gt;&lt;P&gt;SelectedDate = &amp;nbsp;IF(HASONEVALUE ('Date'[Date]) , 'Date'[Date], 'Date'[LastTransDate])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, this always shows the FALSE value of the LastTransDate. I don't know why because when I make a measure of&amp;nbsp;HASONEVALUE ('Date'[Date]) and display that on the report, and then select a single date, the measure shows TRUE, which would lead one to believe the date selected would be the value for SelectedDate. Picture attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2024 21:17:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-t-make-IF-work-properly-when-trying-to-set-a-default-date-v/m-p/4107705#M163006</guid>
      <dc:creator>DougHoog</dc:creator>
      <dc:date>2024-08-19T21:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Can't make IF work properly when trying to set a default date v a date selected in a slicer..</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-t-make-IF-work-properly-when-trying-to-set-a-default-date-v/m-p/4107708#M163007</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried other things like ISBLANK but that hasn't worked either.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2024 21:17:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-t-make-IF-work-properly-when-trying-to-set-a-default-date-v/m-p/4107708#M163007</guid>
      <dc:creator>DougHoog</dc:creator>
      <dc:date>2024-08-19T21:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can't make IF work properly when trying to set a default date v a date selected in a slicer..</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-t-make-IF-work-properly-when-trying-to-set-a-default-date-v/m-p/4107709#M163008</link>
      <description>&lt;P&gt;In the picture, scenario 1 has no date selected and you can see in the green SelectedDate shows the date of last data. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; But scenario 2 does have a date selected in the slicer (July 26, 2024) and the FilteredDateCount shows True, so one would expect the SelectedDate to be 2024-07-26.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2024 21:20:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-t-make-IF-work-properly-when-trying-to-set-a-default-date-v/m-p/4107709#M163008</guid>
      <dc:creator>DougHoog</dc:creator>
      <dc:date>2024-08-19T21:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can't make IF work properly when trying to set a default date v a date selected in a slicer..</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-t-make-IF-work-properly-when-trying-to-set-a-default-date-v/m-p/4108364#M163033</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="794026" data-lia-user-login="DougHoog" class="lia-mention lia-mention-user"&gt;DougHoog&lt;/a&gt;&amp;nbsp;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;&lt;SPAN class=""&gt;I tried to create a sample data myself based on your requirement and implemented the result. Please check if there is anything that can be improved. Here is the steps:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;&lt;SPAN class=""&gt;1.Create simple data:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2.Based on yours, I created two new meausres:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Filtereddate = IF(ISFILTERED('Date'[Date]),MAX('Date'[Date]),'_Invoices'[LastTransDate]) 

Isfiltered = ISFILTERED('Date'[Date]) &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3.The final result is as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Zhu&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 05:57:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-t-make-IF-work-properly-when-trying-to-set-a-default-date-v/m-p/4108364#M163033</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-20T05:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can't make IF work properly when trying to set a default date v a date selected in a slicer..</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-t-make-IF-work-properly-when-trying-to-set-a-default-date-v/m-p/4109512#M163083</link>
      <description>&lt;P&gt;Thank you. I will test this tonight.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 15:21:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-t-make-IF-work-properly-when-trying-to-set-a-default-date-v/m-p/4109512#M163083</guid>
      <dc:creator>DougHoog</dc:creator>
      <dc:date>2024-08-20T15:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Can't make IF work properly when trying to set a default date v a date selected in a slicer..</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-t-make-IF-work-properly-when-trying-to-set-a-default-date-v/m-p/4117570#M163466</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="794026" data-lia-user-login="DougHoog" class="lia-mention lia-mention-user"&gt;DougHoog&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May I ask if you conduct the test and get the expected results?&amp;nbsp;&lt;SPAN data-teams="true"&gt;&lt;SPAN class=""&gt;If so, can you mark the correct answer as solution to help other members find it faster? Thank you very much for your kind cooperation!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Zhu&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2024 02:02:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-t-make-IF-work-properly-when-trying-to-set-a-default-date-v/m-p/4117570#M163466</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-26T02:02:45Z</dc:date>
    </item>
  </channel>
</rss>

