<?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: Switch with dates and text values/format in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3691567#M143446</link>
    <description>&lt;P&gt;That is working to only pull the "Late" orders but it is saying all of the late orders are "In THe Past".&amp;nbsp; I am fairly certain that is incorrect but the source data consists of over 7K lines so let me find one that is "Late in the Future" and see what it is pulling that way.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Feb 2024 17:20:05 GMT</pubDate>
    <dc:creator>jmetf150</dc:creator>
    <dc:date>2024-02-09T17:20:05Z</dc:date>
    <item>
      <title>Switch with dates and text values/format</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3673908#M142570</link>
      <description>&lt;P&gt;I am trying to write a SWITCH function that looks at a TEXT column ( [RS] ), and depending on the text value "OT", then compares between two other DATE columns ( [RDD] &amp;amp; [RCD] )to derive another TEXT column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cond = 
switch(
   'R'[RS]="OT",
   'R'[RDD]&amp;lt;='R'[RCD], "PD",
   "LLT"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 20:23:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3673908#M142570</guid>
      <dc:creator>jmetf150</dc:creator>
      <dc:date>2024-02-01T20:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Switch with dates and text values/format</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3673965#M142574</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="667285" data-lia-user-login="jmetf150" class="lia-mention lia-mention-user"&gt;jmetf150&lt;/a&gt;&amp;nbsp;I think you want:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cond = 
switch(TRUE(),
   'R'[RS]="OT", IF('R'[RDD]&amp;lt;='R'[RCD], "PD", "LLT")
)


or

Cond = 
switch('R'[RS],
   "OT", IF('R'[RDD]&amp;lt;='R'[RCD], "PD", "LLT")
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Feb 2024 20:39:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3673965#M142574</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-02-01T20:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Switch with dates and text values/format</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3674075#M142582</link>
      <description>&lt;P&gt;Deleted so not to confuse anyone&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 22:57:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3674075#M142582</guid>
      <dc:creator>jmetf150</dc:creator>
      <dc:date>2024-02-01T22:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Switch with dates and text values/format</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3674126#M142588</link>
      <description>&lt;P&gt;Ok....I figured it out...my inital formula was incorrect...I was using an "="OT"" sign when I should have been using a "&amp;lt;&amp;gt;""OT".....Thank you very much for the soltuion Greg!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 22:55:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3674126#M142588</guid>
      <dc:creator>jmetf150</dc:creator>
      <dc:date>2024-02-01T22:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Switch with dates and text values/format</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3674519#M142613</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;can you explain the difference between both of your solutions and when you would use one over the other?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 03:11:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3674519#M142613</guid>
      <dc:creator>jmetf150</dc:creator>
      <dc:date>2024-02-02T03:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Switch with dates and text values/format</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3675875#M142714</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="667285" data-lia-user-login="jmetf150" class="lia-mention lia-mention-user"&gt;jmetf150&lt;/a&gt;&amp;nbsp;Well, you would use a "normal" SWITCH statement when you have different values you want to return for different values in a column for example. There's no complex logic required in terms of when you want to return which values. So, let's say you have a column that can contain Pickle, Banana or Cucumber and you want to return 1 for Pickle, 2 for Banana and 3 for Cucumber. This is the second example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 1st example, the SWITCH(TRUE() ) statement is used when you have complex criteria, so return 1 if Pickle and the Value is &amp;gt; 30 for example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note that in this specific use case, you could have used an IF statement,&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;IF( 'R'[RS]="OT" &amp;amp;&amp;amp; 'R'[RDD]&amp;lt;='R'[RCD], "PD", "LLT")&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 02 Feb 2024 15:20:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3675875#M142714</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-02-02T15:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Switch with dates and text values/format</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3684215#M143092</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;to piggy back on this topic on IF/SWITCH, how would I do write the below formula if if I wanted to see orders that are "Late" (i.e. arriving after our need date) and if they are late, are they late in the past (i.e. PO del was last month)&amp;nbsp; or are they late in the future (ie Need date is next month but current PO Due date is even after that).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below is what I have know&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LateStatus = if(ZMMAE[OT X 2 to Cur MRP Need]="Late" &amp;amp;&amp;amp; if(ZMMAE[Del Date]&amp;gt;ZMMAE[Cur MRP Need], "Late in Past" &amp;amp;&amp;amp; if(ZMMAE[Del Date]&amp;lt;ZMMAE[Cur MRP Need],"Late in the Future",""))&lt;/LI-CODE&gt;&lt;P&gt;and I keep getting "Too few arguments were passed to the IF cunction.minimum argument is 2....".&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 23:17:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3684215#M143092</guid>
      <dc:creator>jmetf150</dc:creator>
      <dc:date>2024-02-06T23:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Switch with dates and text values/format</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3688418#M143302</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="667285" data-lia-user-login="jmetf150" class="lia-mention lia-mention-user"&gt;jmetf150&lt;/a&gt;&amp;nbsp;Try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LateStatus = 
  SWITCH( TRUE(),
    ZMMAE[OT X 2 to Cur MRP Need]="Late" &amp;amp;&amp;amp; ZMMAE[Del Date]&amp;gt;ZMMAE[Cur MRP Need], "Late in Past",
    ZMMAE[OT X 2 to Cur MRP Need]="Late" &amp;amp;&amp;amp; ZMMAE[Del Date]&amp;lt;ZMMAE[Cur MRP Need],"Late in the Future",
    ""
  )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 13:13:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3688418#M143302</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-02-08T13:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Switch with dates and text values/format</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3691567#M143446</link>
      <description>&lt;P&gt;That is working to only pull the "Late" orders but it is saying all of the late orders are "In THe Past".&amp;nbsp; I am fairly certain that is incorrect but the source data consists of over 7K lines so let me find one that is "Late in the Future" and see what it is pulling that way.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 17:20:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-with-dates-and-text-values-format/m-p/3691567#M143446</guid>
      <dc:creator>jmetf150</dc:creator>
      <dc:date>2024-02-09T17:20:05Z</dc:date>
    </item>
  </channel>
</rss>

