<?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: Using IF statement with measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IF-statement-with-measure/m-p/2469178#M67178</link>
    <description>&lt;P&gt;The first if statement: if the two measures are blank they are equal and the if statement forces 0 therefore all the previously hidden rows will appear to disply the value 0&lt;/P&gt;&lt;P&gt;the new code checks first if they are not blank then continues with other conditions otherwise returns blank&lt;/P&gt;</description>
    <pubDate>Thu, 21 Apr 2022 13:41:43 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-04-21T13:41:43Z</dc:date>
    <item>
      <title>Using IF statement with measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IF-statement-with-measure/m-p/2467396#M67065</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm facing issues when i try to make an IF statement in a measure, using measures.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did some research myself but can't find the proper solution for my problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a table with project information. Using measures to calculate totals within columns. Next i want to create a measure with IF statement, that is using previous measures.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i try to add the new measure it's showing extremely lots of rows that i don't want to see.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think it's a common thing but i don't know the answer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've created this measure:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;OHW op aanneemsom = &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Measure_Facturatie&lt;/SPAN&gt;&lt;SPAN&gt;[Mijlpalen gefactureerd]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN&gt;Measure_OHW&lt;/SPAN&gt;&lt;SPAN&gt;[Aanneemsom]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 0&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;   IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;   Measure_Algemeen&lt;/SPAN&gt;&lt;SPAN&gt;[Totaal realisatie]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;Measure_OHW&lt;/SPAN&gt;&lt;SPAN&gt;[Aanneemsom]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;   Measure_Algemeen&lt;/SPAN&gt;&lt;SPAN&gt;[Totaal realisatie]&lt;/SPAN&gt;&lt;SPAN&gt; - &lt;/SPAN&gt;&lt;SPAN&gt;Measure_Facturatie&lt;/SPAN&gt;&lt;SPAN&gt;[Mijlpalen gefactureerd]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;      IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;      Measure_Algemeen&lt;/SPAN&gt;&lt;SPAN&gt;[Totaal realisatie]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN&gt;Measure_OHW&lt;/SPAN&gt;&lt;SPAN&gt;[Aanneemsom]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;      Measure_OHW&lt;/SPAN&gt;&lt;SPAN&gt;[Aanneemsom]&lt;/SPAN&gt;&lt;SPAN&gt; - &lt;/SPAN&gt;&lt;SPAN&gt;Measure_Facturatie&lt;/SPAN&gt;&lt;SPAN&gt;[Mijlpalen gefactureerd]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;      0&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;      )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;   )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Each measure i use, is also being used in my table. Values are calculated correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this is the table i created (each line, is a project):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After i add the new measure, this is the result:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you can show my in the right direction.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Rolán&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 19:27:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IF-statement-with-measure/m-p/2467396#M67065</guid>
      <dc:creator>RvanMelis</dc:creator>
      <dc:date>2022-04-20T19:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using IF statement with measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IF-statement-with-measure/m-p/2467452#M67068</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="316746" data-lia-user-login="RvanMelis" class="lia-mention lia-mention-user"&gt;RvanMelis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;OHW op aanneemsom =
IF (
    NOT ISBLANK ( [Mijlpalen gefactureerd] )
        &amp;amp;&amp;amp; NOT ISBLANK ( [Aanneemsom] ) &amp;amp;&amp;amp; NOT ISBLANK ( [Totaal realisatie] ),
    IF (
        [Mijlpalen gefactureerd] &amp;gt;= [Aanneemsom],
        0,
        IF (
            [Totaal realisatie] &amp;lt; [Aanneemsom],
            [Totaal realisatie] - [Mijlpalen gefactureerd],
            IF (
                [Totaal realisatie] &amp;gt;= [Aanneemsom],
                [Aanneemsom] - [Mijlpalen gefactureerd],
                0
            )
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 20:06:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IF-statement-with-measure/m-p/2467452#M67068</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-04-20T20:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using IF statement with measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IF-statement-with-measure/m-p/2469162#M67175</link>
      <description>&lt;P&gt;Hi Tamerj, this works perfectly! Thank you very much.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Can you please explain to me what i did wrong or why your measure works? I'm trying to understand so i can take this into next things.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 13:35:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IF-statement-with-measure/m-p/2469162#M67175</guid>
      <dc:creator>RvanMelis</dc:creator>
      <dc:date>2022-04-21T13:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using IF statement with measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IF-statement-with-measure/m-p/2469178#M67178</link>
      <description>&lt;P&gt;The first if statement: if the two measures are blank they are equal and the if statement forces 0 therefore all the previously hidden rows will appear to disply the value 0&lt;/P&gt;&lt;P&gt;the new code checks first if they are not blank then continues with other conditions otherwise returns blank&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 13:41:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IF-statement-with-measure/m-p/2469178#M67178</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-04-21T13:41:43Z</dc:date>
    </item>
  </channel>
</rss>

