<?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: variable in DAX expression in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/variable-in-DAX-expression/m-p/4031296#M159444</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="408509" data-lia-user-login="powerbiexpert22" class="lia-mention lia-mention-user"&gt;powerbiexpert22&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are no standardized rules for defining variable names. Personally, I usually start my variable names with two "_" so I can quickly determine which one is the variable. This also makes it easier to call them quickly.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR __variablename = ...&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT&gt;It is also recommended that variable names describe this step as much as possible. Avoid using meaningless characters such as "a", "b", "c", etc. as variable names.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;The advantage of variables is that they are calculated only once for each variable (it is important to note here that variables are calculated at the time of definition, not at the time of use), and can be replaced with variables for frequently used parts.&lt;BR /&gt;&lt;BR /&gt;The use of variables after RETURN instead of expressions is useful when checking the results of intermediate steps, and you can always replace the variables after RETURN to check the results.&lt;BR /&gt;&lt;BR /&gt;Hope these help.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Best Regards,&lt;BR /&gt;Gao&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Community Support Team&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;If there is any post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT size="3" color="#008080"&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT size="3"&gt;&lt;FONT color="#008080"&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#008080"&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;Thanks a lot!&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT size="2" color="#FF0000"&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank" rel="noopener nofollow noreferrer"&gt;How to get your questions answered quickly&lt;/A&gt;&amp;nbsp;--&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank" rel="noopener nofollow noreferrer"&gt;&amp;nbsp;How to provide sample data in the Power BI Forum&lt;/A&gt;&amp;nbsp;--&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/China-Power-BI-User-Group/gh-p/ChinaPowerBIUserGroup" target="_blank" rel="noopener"&gt;China Power BI User Group&lt;/A&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jul 2024 01:26:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-07-09T01:26:55Z</dc:date>
    <item>
      <title>variable in DAX expression</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/variable-in-DAX-expression/m-p/4031215#M159437</link>
      <description>&lt;P&gt;what standards or best practices we should follow while defining the variables (including variable name) in DAX expression&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 00:08:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/variable-in-DAX-expression/m-p/4031215#M159437</guid>
      <dc:creator>powerbiexpert22</dc:creator>
      <dc:date>2024-07-09T00:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: variable in DAX expression</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/variable-in-DAX-expression/m-p/4031222#M159439</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="408509" data-lia-user-login="powerbiexpert22" class="lia-mention lia-mention-user"&gt;powerbiexpert22&lt;/a&gt;&amp;nbsp;,&amp;nbsp; SQLBI covers the topic well in their article titled&lt;A href="https://www.sqlbi.com/articles/variables-in-dax/" target="_self"&gt;&amp;nbsp;Variables in DAX,&lt;/A&gt;&amp;nbsp;a part of the DAX101 Series.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="color: darkblue;"&gt;&lt;EM&gt;If your requirement is solved, please make THIS ANSWER a SOLUTION &lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt;&lt;EM&gt; and help other users find the solution quickly. Please hit the LIKE &lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;EM&gt; button if this comment helps you.&amp;nbsp; Proud to be a Super User!&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 00:26:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/variable-in-DAX-expression/m-p/4031222#M159439</guid>
      <dc:creator>foodd</dc:creator>
      <dc:date>2024-07-09T00:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: variable in DAX expression</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/variable-in-DAX-expression/m-p/4031296#M159444</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="408509" data-lia-user-login="powerbiexpert22" class="lia-mention lia-mention-user"&gt;powerbiexpert22&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are no standardized rules for defining variable names. Personally, I usually start my variable names with two "_" so I can quickly determine which one is the variable. This also makes it easier to call them quickly.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR __variablename = ...&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT&gt;It is also recommended that variable names describe this step as much as possible. Avoid using meaningless characters such as "a", "b", "c", etc. as variable names.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;The advantage of variables is that they are calculated only once for each variable (it is important to note here that variables are calculated at the time of definition, not at the time of use), and can be replaced with variables for frequently used parts.&lt;BR /&gt;&lt;BR /&gt;The use of variables after RETURN instead of expressions is useful when checking the results of intermediate steps, and you can always replace the variables after RETURN to check the results.&lt;BR /&gt;&lt;BR /&gt;Hope these help.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Best Regards,&lt;BR /&gt;Gao&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Community Support Team&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;If there is any post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT size="3" color="#008080"&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT size="3"&gt;&lt;FONT color="#008080"&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#008080"&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;Thanks a lot!&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT size="2" color="#FF0000"&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank" rel="noopener nofollow noreferrer"&gt;How to get your questions answered quickly&lt;/A&gt;&amp;nbsp;--&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank" rel="noopener nofollow noreferrer"&gt;&amp;nbsp;How to provide sample data in the Power BI Forum&lt;/A&gt;&amp;nbsp;--&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/China-Power-BI-User-Group/gh-p/ChinaPowerBIUserGroup" target="_blank" rel="noopener"&gt;China Power BI User Group&lt;/A&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 01:26:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/variable-in-DAX-expression/m-p/4031296#M159444</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-09T01:26:55Z</dc:date>
    </item>
  </channel>
</rss>

