<?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: Returning text based on difference in Desktop</title>
    <link>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/735234#M354635</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="150826" data-lia-user-login="evandrocunico" class="lia-mention lia-mention-user"&gt;evandrocunico&lt;/a&gt;&amp;nbsp;many thanks, will try this out. I have created a new column already for date diff and this throws out some random numbers, but I think I know where the issue lies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will respond once I have had the chance to try it out.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jul 2019 12:00:37 GMT</pubDate>
    <dc:creator>UK_User123456</dc:creator>
    <dc:date>2019-07-09T12:00:37Z</dc:date>
    <item>
      <title>Returning text based on difference</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734042#M354090</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way of returning text based on a number that I have got e.g. the difference between date(s)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g.&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date 1&lt;/TD&gt;&lt;TD&gt;Date 2&lt;/TD&gt;&lt;TD&gt;Date Difference&lt;/TD&gt;&lt;TD&gt;Text&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01/01/2019&lt;/TD&gt;&lt;TD&gt;01/06/2019&lt;/TD&gt;&lt;TD&gt;151&lt;/TD&gt;&lt;TD&gt;Exisiting&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12/05/2019&lt;/TD&gt;&lt;TD&gt;01/07/2019&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;New&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01/06/2018&lt;/TD&gt;&lt;TD&gt;31/10/2018&lt;/TD&gt;&lt;TD&gt;152&lt;/TD&gt;&lt;TD&gt;Old&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried nested if statements but all I get is that for every customer we have it displays the same text for every date we have, I just want it to return the text based on the records I need.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 11:12:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734042#M354090</guid>
      <dc:creator>UK_User123456</dc:creator>
      <dc:date>2019-07-08T11:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Returning text based on difference</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734129#M354141</link>
      <description>&lt;P&gt;Based on your example and assuming [Date Difference] is a measure this should work.&lt;/P&gt;&lt;PRE&gt;Text =
SWITCH(
    TRUE(),
    [Date Difference] = 151, "Existing",
    [Date Difference] = 50, "New",
    [Date Difference] = 152, "Old",
    "Other"
)&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jul 2019 13:09:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734129#M354141</guid>
      <dc:creator>jdbuchanan71</dc:creator>
      <dc:date>2019-07-08T13:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Returning text based on difference</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734162#M354156</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="106637" data-lia-user-login="jdbuchanan71" class="lia-mention lia-mention-user"&gt;jdbuchanan71&lt;/a&gt;&amp;nbsp; Thanks for this, but it then throws out the error of MdxScript(Model) (140,98), 'SWITCH' does not support comparing values of type True/False with values of type text. I dont have any columns or values that are of Ture/False types, so not sure why it wont accept the measure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 13:37:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734162#M354156</guid>
      <dc:creator>UK_User123456</dc:creator>
      <dc:date>2019-07-08T13:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Returning text based on difference</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734175#M354162</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="134558" data-lia-user-login="UK_User123456" class="lia-mention lia-mention-user"&gt;UK_User123456&lt;/a&gt;&amp;nbsp;, You will need to share your model, the measure works in my test:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 13:49:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734175#M354162</guid>
      <dc:creator>jdbuchanan71</dc:creator>
      <dc:date>2019-07-08T13:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Returning text based on difference</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734214#M354178</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="106637" data-lia-user-login="jdbuchanan71" class="lia-mention lia-mention-user"&gt;jdbuchanan71&lt;/a&gt;see below the screenshots. The data types should are the same, as there are no true/false.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to be able to say that if the "Date Difference is between a certain number it would return the text I wanted it to display. I have also attached the error message that I receive.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:03:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734214#M354178</guid>
      <dc:creator>UK_User123456</dc:creator>
      <dc:date>2019-07-08T14:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Returning text based on difference</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734234#M354188</link>
      <description>&lt;P&gt;Can you share the nested IF statement that you tried? I dont see any reason as to why a nested if statement wouldnt work here!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:13:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734234#M354188</guid>
      <dc:creator>tex628</dc:creator>
      <dc:date>2019-07-08T14:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Returning text based on difference</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734278#M354217</link>
      <description>&lt;P&gt;Is your field 'Date Difference Last Gift (By Day)' a measure of a column from a table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to change the compare you can change to operator in the measure.&lt;/P&gt;&lt;PRE&gt;Text =
SWITCH(
    TRUE(),
    [Date Difference] &amp;lt; 50, "New",
    [Date Difference] &amp;lt; 151, "Existing",
    [Date Difference] &amp;gt;= 152, "Old",
    "Other"
)&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:42:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734278#M354217</guid>
      <dc:creator>jdbuchanan71</dc:creator>
      <dc:date>2019-07-08T14:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Returning text based on difference</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734441#M354278</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="134558" data-lia-user-login="UK_User123456" class="lia-mention lia-mention-user"&gt;UK_User123456&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;create a column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;date diference = DATEDIFF(date1;date2;DAY)&amp;nbsp; (use semicolon or comma)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;create another column:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;text result = If (date diference &amp;lt;= 50;"New";date diference &amp;lt;= 150;"Existing";"Old")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;best regards.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 08 Jul 2019 18:02:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/734441#M354278</guid>
      <dc:creator>evandrocunico</dc:creator>
      <dc:date>2019-07-08T18:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Returning text based on difference</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/735234#M354635</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="150826" data-lia-user-login="evandrocunico" class="lia-mention lia-mention-user"&gt;evandrocunico&lt;/a&gt;&amp;nbsp;many thanks, will try this out. I have created a new column already for date diff and this throws out some random numbers, but I think I know where the issue lies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will respond once I have had the chance to try it out.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 12:00:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Returning-text-based-on-difference/m-p/735234#M354635</guid>
      <dc:creator>UK_User123456</dc:creator>
      <dc:date>2019-07-09T12:00:37Z</dc:date>
    </item>
  </channel>
</rss>

