<?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 Compare Month and Year from Date String in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-Month-and-Year-from-Date-String/m-p/3657599#M141712</link>
    <description>&lt;P&gt;Hello All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a formula that compares two dates: Table1[Date] and Table 2[Date] and then returns "Late" if Table1[Date] is later than Table2[Date] or "Current" if&amp;nbsp;Table1[Date] is the same as Table2[Date] or "Pending" if Table1[Date] has no value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is I need it to just look at month and year and not the day. As an example, 1 Oct 2023 and 15 Oct 2023 would be considered the same since month and year are the same. 1 Nov 2023 and 1 Oct 2023 would be "late" since month and year are different.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2024 16:13:40 GMT</pubDate>
    <dc:creator>Userpath77</dc:creator>
    <dc:date>2024-01-24T16:13:40Z</dc:date>
    <item>
      <title>Compare Month and Year from Date String</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-Month-and-Year-from-Date-String/m-p/3657599#M141712</link>
      <description>&lt;P&gt;Hello All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a formula that compares two dates: Table1[Date] and Table 2[Date] and then returns "Late" if Table1[Date] is later than Table2[Date] or "Current" if&amp;nbsp;Table1[Date] is the same as Table2[Date] or "Pending" if Table1[Date] has no value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is I need it to just look at month and year and not the day. As an example, 1 Oct 2023 and 15 Oct 2023 would be considered the same since month and year are the same. 1 Nov 2023 and 1 Oct 2023 would be "late" since month and year are different.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 16:13:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-Month-and-Year-from-Date-String/m-p/3657599#M141712</guid>
      <dc:creator>Userpath77</dc:creator>
      <dc:date>2024-01-24T16:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Month and Year from Date String</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-Month-and-Year-from-Date-String/m-p/3657661#M141717</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="117140" data-lia-user-login="User" class="lia-mention lia-mention-user"&gt;User&lt;/a&gt;&amp;nbsp;, You can try using below method&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;StatusColumn =&lt;BR /&gt;VAR CurrentDate = Table1[Date]&lt;BR /&gt;VAR OtherDate = Table2[Date]&lt;BR /&gt;RETURN&lt;BR /&gt;SWITCH (&lt;BR /&gt;TRUE (),&lt;BR /&gt;ISBLANK ( CurrentDate ), "Pending",&lt;BR /&gt;YEAR ( CurrentDate ) = YEAR ( OtherDate ) &amp;amp;&amp;amp; MONTH ( CurrentDate ) = MONTH ( OtherDate ), "Current",&lt;BR /&gt;CurrentDate &amp;gt; OtherDate, "Late",&lt;BR /&gt;"Pending"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please accept as solution and give kudos if it helps&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 16:41:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-Month-and-Year-from-Date-String/m-p/3657661#M141717</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2024-01-24T16:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Month and Year from Date String</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-Month-and-Year-from-Date-String/m-p/3657753#M141727</link>
      <description>&lt;P&gt;Thanks Bhanu. I tried but the formula seems to only let me use measures for Current Date and Other Date. Both date fields are columns in two seperate tables. Any thoughts on how to modify?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 17:21:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-Month-and-Year-from-Date-String/m-p/3657753#M141727</guid>
      <dc:creator>Userpath77</dc:creator>
      <dc:date>2024-01-24T17:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Month and Year from Date String</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-Month-and-Year-from-Date-String/m-p/3658988#M141779</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="310802" data-lia-user-login="Userpath77" class="lia-mention lia-mention-user"&gt;Userpath77&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try below formula:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Status =
IF (
    HASONEVALUE ( Table2[Date] ),
    IF (
        ISBLANK ( MAX ( Table1[Date] ) ),
        "Pending",
        IF (
            YEAR ( MAX ( Table1[Date] ) ) = YEAR ( MAX ( Table2[Date] ) )
                &amp;amp;&amp;amp; MONTH ( MAX ( Table1[Date] ) ) = MONTH ( MAX ( Table2[Date] ) ),
            "Current",
            IF ( MAX ( Table1[Date] ) &amp;gt; MAX ( Table2[Date] ), "Late", "Pending" )
        )
    ),
    BLANK ()
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Adamk Kong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 06:30:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-Month-and-Year-from-Date-String/m-p/3658988#M141779</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-25T06:30:30Z</dc:date>
    </item>
  </channel>
</rss>

