<?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: If statement doesn't work in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-doesn-t-work/m-p/2356597#M60041</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="361094" data-lia-user-login="elif" class="lia-mention lia-mention-user"&gt;elif&lt;/a&gt; , This will not work as column, &lt;/P&gt;
&lt;P&gt;You have create a measure as, you are using measure in calculation&lt;/P&gt;
&lt;P&gt;POS Type NEW = IF([is grater] = 1, "NPI", max('Product'[POS type]) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not get this working as a Column, you need an independent table(assume&amp;nbsp;POS Type)&amp;nbsp; with these two values.&amp;nbsp; using a group by NPI name you need create a new measure to get this working&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new Measure &lt;BR /&gt;Sumx(filter(Values(Table[MPI Name]), [POS Type NEW] = max(POS Type[POS Type])), [measure]) &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;refer this blog or video for steps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dynamic Segmentation Bucketing Binning&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Dynamic Segmentation, Bucketing or Binning: &lt;A href="https://youtu.be/CuczXPj0N-k" target="_blank"&gt;https://youtu.be/CuczXPj0N-k&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Feb 2022 15:58:44 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-02-23T15:58:44Z</dc:date>
    <item>
      <title>If statement doesn't work</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-doesn-t-work/m-p/2354152#M59875</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a problem with IF statement which is not working perfectly, do you have any idea why it is not working very well?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;is grater = &lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;maxtable1&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'[Date]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;USERELATIONSHIP&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Product'[NPI End Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Date'[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)) &lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;maxtable2&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Product'[NPI End Date]&lt;/SPAN&gt;&lt;SPAN&gt;)) &lt;/SPAN&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;maxtable2&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN&gt;maxtable1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;POS Type NEW = &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[is grater]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"NPI"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Product'[POS type]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;There is an inactive relationship between the&amp;nbsp;&lt;SPAN&gt;Product'[NPI End Date] and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Date'[Date]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 22 Feb 2022 18:39:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-doesn-t-work/m-p/2354152#M59875</guid>
      <dc:creator>elif</dc:creator>
      <dc:date>2022-02-22T18:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: If statement doesn't work</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-doesn-t-work/m-p/2354984#M59926</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="361094" data-lia-user-login="elif" class="lia-mention lia-mention-user"&gt;elif&lt;/a&gt; , If this is a column, this will not work&lt;/P&gt;
&lt;P&gt;POS Type NEW = IF([is grater] = 1, "NPI", 'Product'[POS type])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It needs to be a measure&lt;/P&gt;
&lt;P&gt;example&lt;/P&gt;
&lt;P&gt;POS Type NEW = IF([is grater] = 1, "NPI", max('Product'[POS type]) ) &lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 06:14:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-doesn-t-work/m-p/2354984#M59926</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-02-23T06:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: If statement doesn't work</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-doesn-t-work/m-p/2356578#M60040</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried both of them but still not working. When I try your suggestion it gives me just 2 Product Type but has to be 5 like Core Product, Identity, NPI, Custom, outofscope, and the NPI calculation is wrong as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 15:53:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-doesn-t-work/m-p/2356578#M60040</guid>
      <dc:creator>elif</dc:creator>
      <dc:date>2022-02-23T15:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: If statement doesn't work</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-doesn-t-work/m-p/2356597#M60041</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="361094" data-lia-user-login="elif" class="lia-mention lia-mention-user"&gt;elif&lt;/a&gt; , This will not work as column, &lt;/P&gt;
&lt;P&gt;You have create a measure as, you are using measure in calculation&lt;/P&gt;
&lt;P&gt;POS Type NEW = IF([is grater] = 1, "NPI", max('Product'[POS type]) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not get this working as a Column, you need an independent table(assume&amp;nbsp;POS Type)&amp;nbsp; with these two values.&amp;nbsp; using a group by NPI name you need create a new measure to get this working&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new Measure &lt;BR /&gt;Sumx(filter(Values(Table[MPI Name]), [POS Type NEW] = max(POS Type[POS Type])), [measure]) &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;refer this blog or video for steps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dynamic Segmentation Bucketing Binning&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Dynamic Segmentation, Bucketing or Binning: &lt;A href="https://youtu.be/CuczXPj0N-k" target="_blank"&gt;https://youtu.be/CuczXPj0N-k&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 15:58:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-doesn-t-work/m-p/2356597#M60041</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-02-23T15:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: If statement doesn't work</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-doesn-t-work/m-p/2359991#M60271</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="361094" data-lia-user-login="elif" class="lia-mention lia-mention-user"&gt;elif&lt;/a&gt;&amp;nbsp;;&lt;/P&gt;
&lt;P&gt;Can you share&amp;nbsp;&amp;nbsp;a simple data removing sensitive information, along with the results you want to output?&lt;BR /&gt;&lt;BR /&gt;It makes it easier to give you a solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team_ Yalan Wu&lt;BR /&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 02:06:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-doesn-t-work/m-p/2359991#M60271</guid>
      <dc:creator>v-yalanwu-msft</dc:creator>
      <dc:date>2022-02-25T02:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: If statement doesn't work</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-doesn-t-work/m-p/2369098#M60729</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="361094" data-lia-user-login="elif" class="lia-mention lia-mention-user"&gt;elif&lt;/a&gt;&amp;nbsp;;&lt;/P&gt;
&lt;DIV&gt;Is your problem solved? If so, Would you mind accept the helpful replies as solutions? Then we could close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;Best Regards,&lt;/DIV&gt;
&lt;DIV&gt;Community Support Team_ Yalan Wu&lt;/DIV&gt;
If this post&lt;STRONG&gt;&lt;I&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider&lt;STRONG&gt;&lt;I&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/DIV&gt;</description>
      <pubDate>Wed, 02 Mar 2022 05:41:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-doesn-t-work/m-p/2369098#M60729</guid>
      <dc:creator>v-yalanwu-msft</dc:creator>
      <dc:date>2022-03-02T05:41:53Z</dc:date>
    </item>
  </channel>
</rss>

