<?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: Filtering Variable to Return Single Row in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2565710#M73099</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Measures cannot refer to variables defined outside the measure expression, but can refer to functional scope variables defined within the expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/EN-US/dax/var-dax#remarks" target="_blank"&gt;VAR keyword (DAX) - DAX | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you share some example data or pbix file without sensitive data and expect result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jun 2022 07:02:09 GMT</pubDate>
    <dc:creator>v-chenwuz-msft</dc:creator>
    <dc:date>2022-06-08T07:02:09Z</dc:date>
    <item>
      <title>Filtering Variable to Return Single Row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2553305#M72352</link>
      <description>&lt;P&gt;Hello All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've come across an issue when attempting to set up a measure to be used in a switch function. Below is my current dax expression:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Value =&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;RatexFX&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;HASONEFILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Account[Sub-Account3]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;(Sales/Volume)&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Account[Sub-Account3]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;SPAN&gt;(Sales/Volume)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)-&lt;/SPAN&gt;&lt;SPAN&gt;[FX]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;RatexFX&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Combined P&amp;amp;L'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Combined P&amp;amp;L'[Sub-Account3]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"Customer Sales"&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;BR /&gt;In the above measure, I am looking to utilize the RatexFX variable to only show the Rate xFX value for Customer Sales. When done in an individual measure, the desired result is given, but when using Variable, the filter in the Return function does nothing, and the Rate xFX function is shown for all accounts.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 01 Jun 2022 15:37:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2553305#M72352</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-01T15:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Variable to Return Single Row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2555217#M72510</link>
      <description>&lt;P&gt;the term "VAR"&amp;nbsp; is misleading, unfortunately.&amp;nbsp; It should have been named "CONST"&amp;nbsp; because that's what it is, a constant.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to move it inside the CALCULATE statement to be effective&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Value =
Calculate(IF(HASONEFILTER(Account[Sub-Account3]),(Sales/Volume),SUMX(VALUES(Account[Sub-Account3]),(Sales/Volume))-[FX],FILTER('Combined P&amp;amp;L','Combined P&amp;amp;L'[Sub-Account3]="Customer Sales"))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Might even need to bring the switch out further.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 11:49:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2555217#M72510</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-06-02T11:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Variable to Return Single Row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2555454#M72522</link>
      <description>&lt;P&gt;Hi Ibendlin,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Appreciate the insight. I provided the above details as a skimmed down version of what I am trying to calculate. In the end DAX expression, I am looking to use a SWITCH formula in a waterfall that then looks at multiple accounts. So in the end it would be:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Value =&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;RatexFX&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;HASONEFILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Account[Sub-Account3]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;(Sales/Volume)&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Account[Sub-Account3]&lt;/SPAN&gt;&lt;SPAN&gt;),(Sales/Volume)&lt;/SPAN&gt;&lt;SPAN&gt;)-&lt;/SPAN&gt;&lt;SPAN&gt;[FX]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;BR /&gt;Switch(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1, Calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;RatexFX&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Combined P&amp;amp;L'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Combined P&amp;amp;L'[Sub-Account3]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"Customer Sales"&lt;/SPAN&gt;&lt;SPAN&gt;)),&lt;BR /&gt;2, Calculate(RatexFX,FILTER('Combined P&amp;amp;L','Combined P&amp;amp;L'[Sub-Account3]="Marketing Expense")),&lt;BR /&gt;3, Calculate(RatexFX,FILTER('Combined P&amp;amp;L','Combined P&amp;amp;L'[Sub-Account3]="Employee Wages")),&amp;nbsp;&lt;BR /&gt;4, Calculate(RatexFX,FILTER('Combined P&amp;amp;L','Combined P&amp;amp;L'[Sub-Account3]="SG&amp;amp;A")),&lt;BR /&gt;BLANK()).&lt;BR /&gt;&lt;BR /&gt;Thus, the goal of using the variable is to then not have to calculate RatexFX on every step of the SWITCH, but instead perform it once at the beginning. When using the variable, each step of the switch ignores the filter, and instead just displays total Rate xFX.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 12:57:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2555454#M72522</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-02T12:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Variable to Return Single Row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2555467#M72523</link>
      <description>&lt;P&gt;I already explained why that is the case. You cannot do it this way. Move the SWITCH &lt;STRONG&gt;inside&lt;/STRONG&gt; the CALCULATE.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 13:01:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2555467#M72523</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-06-02T13:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Variable to Return Single Row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2555505#M72525</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Can you show an example of what you mean by inside? Sorry, just a little confused on that.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 13:18:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2555505#M72525</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-02T13:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Variable to Return Single Row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2555539#M72528</link>
      <description>&lt;P&gt;instead of SWITCH(...,CALCULATE())&amp;nbsp; you need to do CALCULATE(SWITCH(...))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. I cannot use screenshots of your source data.&lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 13:30:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2555539#M72528</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-06-02T13:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Variable to Return Single Row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2555559#M72531</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;As a test I have written the below and got the following error:&lt;BR /&gt;&lt;BR /&gt;Test Value = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Rate xFX]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;SWITCH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'NS Account Table'[Index]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Combined P&amp;amp;L'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Combined P&amp;amp;L'[Sub Account 3]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"Customer Sales"&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Combined P&amp;amp;L'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Combined P&amp;amp;L'[Sub Account 3]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"CPU Allowance"&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Combined P&amp;amp;L'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Combined P&amp;amp;L'[Sub Account 3]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"Slotting"&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Combined P&amp;amp;L'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Combined P&amp;amp;L'[Sub Account 3]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"Coupons"&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;()))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;A function 'FILTER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 13:36:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2555559#M72531</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-02T13:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Variable to Return Single Row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2563056#M72967</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There a&amp;nbsp;syntax error in your formula.&lt;/P&gt;
&lt;P&gt;syntax of SWITCH()&lt;/P&gt;
&lt;P&gt;SWITCH(&amp;lt;expression&amp;gt;, &amp;lt;value&amp;gt;, &amp;lt;result&amp;gt;[, &amp;lt;value&amp;gt;, &amp;lt;result&amp;gt;]…[, &amp;lt;else&amp;gt;])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You missed &lt;STRONG&gt;&amp;lt;expression&amp;gt;&lt;/STRONG&gt; in your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Value =&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;RatexFX&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;HASONEFILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Account[Sub-Account3]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;(Sales/Volume)&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Account[Sub-Account3]&lt;/SPAN&gt;&lt;SPAN&gt;),(Sales/Volume)&lt;/SPAN&gt;&lt;SPAN&gt;)-&lt;/SPAN&gt;&lt;SPAN&gt;[FX]&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;BR /&gt;Switch( &lt;STRONG&gt;selectedvalue(&amp;nbsp;waterfall's X-axis ),&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;1, Calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;RatexFX&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Combined P&amp;amp;L'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Combined P&amp;amp;L'[Sub-Account3]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"Customer Sales"&lt;/SPAN&gt;&lt;SPAN&gt;)),&lt;BR /&gt;2, Calculate(RatexFX,FILTER('Combined P&amp;amp;L','Combined P&amp;amp;L'[Sub-Account3]="Marketing Expense")),&lt;BR /&gt;3, Calculate(RatexFX,FILTER('Combined P&amp;amp;L','Combined P&amp;amp;L'[Sub-Account3]="Employee Wages")),&amp;nbsp;&lt;BR /&gt;4, Calculate(RatexFX,FILTER('Combined P&amp;amp;L','Combined P&amp;amp;L'[Sub-Account3]="SG&amp;amp;A")),&lt;BR /&gt;BLANK()).&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;If you need more help, please share your example data and expect result.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 07:18:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2563056#M72967</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-06-07T07:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Variable to Return Single Row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2564046#M73016</link>
      <description>&lt;P&gt;Hi, thanks for the tip, but I believe the issue is continuing to persist even with the above solution.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Below you can see the comparison of two DAX expressions:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Test Value =&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;RatexFX&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;[Rate xFX]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;RatexFX&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Account&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Account[Sub-Account1]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"Customer Sales"&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Rate xFX LP = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'Combined P&amp;amp;L'&lt;/SPAN&gt;&lt;SPAN&gt;[Rate xFX]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Account[Sub-Account1]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"Customer Sales"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;As you can see in the below table, test value continues to do the calculation for all accounts.&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 13:23:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2564046#M73016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-07T13:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Variable to Return Single Row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2565710#M73099</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Measures cannot refer to variables defined outside the measure expression, but can refer to functional scope variables defined within the expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/EN-US/dax/var-dax#remarks" target="_blank"&gt;VAR keyword (DAX) - DAX | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you share some example data or pbix file without sensitive data and expect result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 07:02:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Variable-to-Return-Single-Row/m-p/2565710#M73099</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-06-08T07:02:09Z</dc:date>
    </item>
  </channel>
</rss>

