<?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: Basic &amp;quot;IF&amp;quot; not working in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Basic-quot-IF-quot-not-working/m-p/844909#M6503</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did opened a new report, got the data "as new" and the same formula is working fine now...&lt;/P&gt;&lt;P&gt;Thanks for the help and for the tip!&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2019 13:01:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-11-13T13:01:24Z</dc:date>
    <item>
      <title>Basic "IF" not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Basic-quot-IF-quot-not-working/m-p/814716#M5358</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use an IF statement to create categories for my data based in a number value.&lt;/P&gt;&lt;P&gt;I have a table with a column distance_covered (I checked and is number type). I want to create a new column that categorize the data in "Less than 5", "5 to 15", "15 to 25", "25 to 75" and "75 to 300".&lt;/P&gt;&lt;P&gt;The formula I'm using is:&amp;nbsp;Distance Category = IF(bi_goto_session[distance_covered] &amp;gt; 0 &amp;amp;&amp;amp; bi_goto_session[distance_covered] &amp;lt; 5, "Less than 5", IF(bi_goto_session[distance_covered] &amp;gt;= 5 &amp;amp;&amp;amp; bi_goto_session[distance_covered] &amp;lt; 15, "5 to 15", IF( bi_goto_session[distance_covered] &amp;gt;= 15 &amp;amp;&amp;amp; bi_goto_session[distance_covered] &amp;lt; 25, "15 to 25", IF(bi_goto_session[distance_covered] &amp;gt;= 25 &amp;amp;&amp;amp; bi_goto_session[distance_covered] &amp;lt; 75 , "25 to 75", IF(bi_goto_session[distance_covered] &amp;gt;= 75 &amp;amp;&amp;amp; bi_goto_session[distance_covered] &amp;lt; 300, "75 to 300")))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the results are:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas why??&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 12:10:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Basic-quot-IF-quot-not-working/m-p/814716#M5358</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-10T12:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Basic "IF" not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Basic-quot-IF-quot-not-working/m-p/814721#M5359</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you let us know of the Data types of the Distance_Covered Column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Vignesh M&lt;BR /&gt;&lt;BR /&gt;If what I suggested worked for you feel free to Drop a "&lt;STRONG&gt;Kudos&lt;/STRONG&gt;" and Consider to "&lt;STRONG&gt;Accept as Solution&lt;/STRONG&gt;" if I solved your Issue :)&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 12:14:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Basic-quot-IF-quot-not-working/m-p/814721#M5359</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-10T12:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Basic "IF" not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Basic-quot-IF-quot-not-working/m-p/838372#M6290</link>
      <description>&lt;P&gt;The data type and format of distance_covered is Decimal number.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 07:56:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Basic-quot-IF-quot-not-working/m-p/838372#M6290</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-06T07:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Basic "IF" not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Basic-quot-IF-quot-not-working/m-p/838449#M6291</link>
      <description>&lt;P&gt;Maybe there is something wrong with the data type of your distance_covered column. I created a same table that has distance_covered's data type is Decimal number and it's working correctly with your IF formula&lt;BR /&gt;&lt;BR /&gt;But I have some tip for you, instead of using many IF in a formula, we can use SWITCH, it will make your code look cleaner&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Distance Category =
VAR distance = bi_goto_session[distance_covered]
RETURN SWITCH(TRUE(),
   distance &amp;gt; 0 &amp;amp;&amp;amp; distance &amp;lt; 5, "Less than 5",
   distance &amp;gt;= 5 &amp;amp;&amp;amp; distance &amp;lt; 15, "5 to 15",
   distance &amp;gt;= 15 &amp;amp;&amp;amp; distance &amp;lt; 25, "15 to 25",
   distance &amp;gt;= 25 &amp;amp;&amp;amp; distance &amp;lt; 75, "25 to 75",
   distance &amp;gt;= 75 &amp;amp;&amp;amp; distance &amp;lt; 300, "75 to 300")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 Nov 2019 08:48:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Basic-quot-IF-quot-not-working/m-p/838449#M6291</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-06T08:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Basic "IF" not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Basic-quot-IF-quot-not-working/m-p/844909#M6503</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did opened a new report, got the data "as new" and the same formula is working fine now...&lt;/P&gt;&lt;P&gt;Thanks for the help and for the tip!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 13:01:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Basic-quot-IF-quot-not-working/m-p/844909#M6503</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-13T13:01:24Z</dc:date>
    </item>
  </channel>
</rss>

