<?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: RETURN in the middle of a DAX statement in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RETURN-in-the-middle-of-a-DAX-statement/m-p/4266249#M169095</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="834224" data-lia-user-login="Hila_DG_TMX" class="lia-mention lia-mention-user"&gt;Hila_DG_TMX&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This should be the correct syntax:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;0.1 My Col =
IF (
    Table[column],
    8,
    VAR _V1 = calc
    VAR _V2 = calc
    VAR _V3 = calc
    RETURN
        _V1 + _V2 + _V3
)&lt;/LI-CODE&gt;
&lt;P&gt;The three variables should only be evaluated when the condition within IF is false.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this work as expected for you?&lt;/P&gt;</description>
    <pubDate>Fri, 01 Nov 2024 01:39:01 GMT</pubDate>
    <dc:creator>OwenAuger</dc:creator>
    <dc:date>2024-11-01T01:39:01Z</dc:date>
    <item>
      <title>RETURN in the middle of a DAX statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RETURN-in-the-middle-of-a-DAX-statement/m-p/4266232#M169093</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a complex DAX statment to calculate a column (yes, I know, don't get me started).&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It has several calculations, all organised nicely using VAR statements.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is as follows:&lt;/P&gt;&lt;P&gt;I want the code to return a specific value if a certain condition is met in the 1st go, and then not run through the extra caculations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, instead of:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;0.1 My Col = 

 _VAR _V1 = calc
 _VAR _V2 = calc
 _VAR _V3 = calc
VAR _RET = IF (Table[column], 8, _v1 + v2 +v3)
RETURN _RET&lt;/LI-CODE&gt;&lt;P&gt;Which means I would run all 3 calcs,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to write something like:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;0.1 My Col = 
IF (Table[column], 
   RETURN 8, 
   _VAR _V1 = calc
   _VAR _V2 = calc
   _VAR _V3 = calc
   RETURN _v1 + v2 +v3
)&lt;/LI-CODE&gt;&lt;P&gt;I don't get it to work.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it even possible? Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 01:27:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RETURN-in-the-middle-of-a-DAX-statement/m-p/4266232#M169093</guid>
      <dc:creator>Hila_DG_TMX</dc:creator>
      <dc:date>2024-11-01T01:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: RETURN in the middle of a DAX statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RETURN-in-the-middle-of-a-DAX-statement/m-p/4266249#M169095</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="834224" data-lia-user-login="Hila_DG_TMX" class="lia-mention lia-mention-user"&gt;Hila_DG_TMX&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This should be the correct syntax:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;0.1 My Col =
IF (
    Table[column],
    8,
    VAR _V1 = calc
    VAR _V2 = calc
    VAR _V3 = calc
    RETURN
        _V1 + _V2 + _V3
)&lt;/LI-CODE&gt;
&lt;P&gt;The three variables should only be evaluated when the condition within IF is false.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this work as expected for you?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 01:39:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RETURN-in-the-middle-of-a-DAX-statement/m-p/4266249#M169095</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2024-11-01T01:39:01Z</dc:date>
    </item>
  </channel>
</rss>

