<?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: My calculation does not work using variable (row context issue or something else?) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028529#M45425</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24542" data-lia-user-login="PaulDBrown" class="lia-mention lia-mention-user"&gt;PaulDBrown&lt;/a&gt;&amp;nbsp;Thank you for your help. Yea. I was modifying the original file as I put [ConsentDate] instead of [Consent].&amp;nbsp; I was/am trying to create a logic "&lt;STRONG&gt;exists&lt;/STRONG&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess " = 1" was silly. Here is what I am trying to say:&amp;nbsp; If on the &lt;STRONG&gt;Row context level&lt;/STRONG&gt;, if this particular row meets this condition (Step =1 &amp;amp; Consent = "Not Eligible"), result should be "".&lt;/P&gt;</description>
    <pubDate>Fri, 20 Aug 2021 17:52:11 GMT</pubDate>
    <dc:creator>JustinDoh1</dc:creator>
    <dc:date>2021-08-20T17:52:11Z</dc:date>
    <item>
      <title>My calculation does not work using variable (row context issue or something else?)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2027013#M45342</link>
      <description>&lt;P&gt;I am sharing my Pbix file &lt;A href="https://drive.google.com/file/d/1WYraf0TIyP3ZyWHnw6fhTKAuGQbDQItm/view?usp=sharing" target="_self"&gt;here&lt;/A&gt;.&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I posted a &lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/Total-comes-out-as-zero-while-using-Switch-statement/m-p/2024575" target="_self"&gt;similar question&lt;/A&gt; yesterday, but this is little bit different (because I am trying to see whether somehow my logic has an error: ex "vNotEligibleStep1 = 1"). I am trying to &lt;STRONG&gt;express&lt;/STRONG&gt; "if vNotEligibleStep1 &lt;STRONG&gt;case exisits&lt;/STRONG&gt;".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the Pbix file that I am sharing, the issue is whenever we have an output (this case: Tina Turner = 1 &amp;amp; Michael Jaskson = 1) with one of three (Doe. D or Doe, W - where we have 'Not Eligible" as "Content" column), it gives a row context error (total does not sum up). I am not sure how to fix it or where the error is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is a mesasure called "&lt;STRONG&gt;Step1_0819&lt;/STRONG&gt;" in the file.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I missing something on the calculation for VAR or how do I go about fixing where it is&amp;nbsp;&lt;SPAN&gt;"vNotEligibleStep1 = 1" ?&lt;BR /&gt;Do I have to use Summarize function or how do I go about making the row context more obvious?&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks you so much for help!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 17:50:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2027013#M45342</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2021-08-20T17:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: My calculation does not work using variable (row context issue or something else?)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2027722#M45378</link>
      <description>&lt;P&gt;But Michael Jackson???&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 07:43:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2027722#M45378</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-20T07:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: My calculation does not work using variable (row context issue or something else?)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028459#M45417</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Thank you for response. I would like to follow up if you could help me with any suggestions regards to how to fix the row context issue I am having. (BTW, I added "Tina Turner" in the Pbix file. Sorry I like oldies. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; )&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 16:34:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028459#M45417</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2021-08-20T16:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: My calculation does not work using variable (row context issue or something else?)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028523#M45422</link>
      <description>&lt;P&gt;I see you've changed the measure, since this step was always going to return 1&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now the rogue variable returns a &lt;STRONG&gt;date&lt;/STRONG&gt;, (specifically the MAX(Data[&lt;STRONG&gt;consentdate&lt;/STRONG&gt;])based on the filters) but the first clause in the switch function checks to see if the variable returns &lt;STRONG&gt;1&lt;/STRONG&gt; (a whole number; not a date). So I would assume the result is always false, since a date is never "1"...&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 17:17:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028523#M45422</guid>
      <dc:creator>PaulDBrown</dc:creator>
      <dc:date>2021-08-20T17:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: My calculation does not work using variable (row context issue or something else?)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028529#M45425</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24542" data-lia-user-login="PaulDBrown" class="lia-mention lia-mention-user"&gt;PaulDBrown&lt;/a&gt;&amp;nbsp;Thank you for your help. Yea. I was modifying the original file as I put [ConsentDate] instead of [Consent].&amp;nbsp; I was/am trying to create a logic "&lt;STRONG&gt;exists&lt;/STRONG&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess " = 1" was silly. Here is what I am trying to say:&amp;nbsp; If on the &lt;STRONG&gt;Row context level&lt;/STRONG&gt;, if this particular row meets this condition (Step =1 &amp;amp; Consent = "Not Eligible"), result should be "".&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 17:52:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028529#M45425</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2021-08-20T17:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: My calculation does not work using variable (row context issue or something else?)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028544#M45427</link>
      <description>&lt;P&gt;How about this for the variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;Var vNotEligibleStep1 = 
    COUNTROWS(
        FILTER(
            Data,
            Data[Consent] = "Not Eligible"  &amp;amp;&amp;amp;
            Data[Step] = 1
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will return 1 for each row which meets the filtered criteria. You can now keep the switch function clause.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 17:38:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028544#M45427</guid>
      <dc:creator>PaulDBrown</dc:creator>
      <dc:date>2021-08-20T17:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: My calculation does not work using variable (row context issue or something else?)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028563#M45429</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24542" data-lia-user-login="PaulDBrown" class="lia-mention lia-mention-user"&gt;PaulDBrown&lt;/a&gt;&amp;nbsp;Thank you for help. It definitely made the argument works. However, I see the total comes as 4 instead of 2. Is there way to fix this by chance?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 17:47:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028563#M45429</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2021-08-20T17:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: My calculation does not work using variable (row context issue or something else?)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028602#M45435</link>
      <description>&lt;P&gt;The problem appears to be the variable Step1.&lt;/P&gt;
&lt;P&gt;try:&lt;/P&gt;
&lt;P&gt;CALCULATE(&lt;/P&gt;
&lt;P&gt;DISTINCTCOUN(Data[ClientID]),&lt;/P&gt;
&lt;P&gt;FILTER(Data,&lt;/P&gt;
&lt;P&gt;Data[Step] = 1 &amp;amp;&amp;amp; Data[Consent] &amp;lt;&amp;gt; "Refused" &amp;amp;&amp;amp; NOT(ISBLANK(Data[Consent]))))&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 18:05:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028602#M45435</guid>
      <dc:creator>PaulDBrown</dc:creator>
      <dc:date>2021-08-20T18:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: My calculation does not work using variable (row context issue or something else?)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028607#M45436</link>
      <description>&lt;P&gt;Alternatively you can try:&lt;/P&gt;
&lt;P&gt;new measure = SUMX(Data, [Step 1_0819])&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 18:08:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028607#M45436</guid>
      <dc:creator>PaulDBrown</dc:creator>
      <dc:date>2021-08-20T18:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: My calculation does not work using variable (row context issue or something else?)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028623#M45438</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24542" data-lia-user-login="PaulDBrown" class="lia-mention lia-mention-user"&gt;PaulDBrown&lt;/a&gt;&amp;nbsp;Actually, SUMX made more output of rows, so I think it might not be the solution, but I need to review data more. Thank you so much for all your help.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 18:29:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028623#M45438</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2021-08-20T18:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: My calculation does not work using variable (row context issue or something else?)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028755#M45443</link>
      <description>&lt;P&gt;Can you post the updated PBIX file? Maybe we can take it step by step.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 19:08:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028755#M45443</guid>
      <dc:creator>PaulDBrown</dc:creator>
      <dc:date>2021-08-20T19:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: My calculation does not work using variable (row context issue or something else?)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028854#M45456</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24542" data-lia-user-login="PaulDBrown" class="lia-mention lia-mention-user"&gt;PaulDBrown&lt;/a&gt;&amp;nbsp;&lt;A href="https://drive.google.com/file/d/1jwCcT6yrKi_eBBblyb9LKlIHS5PdV5F-/view?usp=sharing" target="_self"&gt;here&lt;/A&gt; is a link to the updated Pbix file. I guess I am leaning toward using SUMX (on this particular small data).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;But, when I use other larger datasets (for other column, but with same approach (using Countrows --&amp;gt; SUMX), instead of showing 1, it shows as 2 occurrences. I guess there are duplicate occurrences with same condition. What should I do?&amp;nbsp;&amp;nbsp;How can I make the &lt;STRONG&gt;dinstinct (SUMX)&lt;/STRONG&gt;?&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Aug 2021 00:20:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2028854#M45456</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2021-08-21T00:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: My calculation does not work using variable (row context issue or something else?)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2030477#M45527</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24542" data-lia-user-login="PaulDBrown" class="lia-mention lia-mention-user"&gt;PaulDBrown&lt;/a&gt;&amp;nbsp;I have created a &lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/td-p/2030465" target="_self"&gt;new question&lt;/A&gt; regards to SUMX. I am really struggling to find the solution for getting &lt;STRONG&gt;Total&lt;/STRONG&gt; on the bottom of Matrix because if use SUMX, it creates multiple output (rather than 1), but when I use SUMX, Total comes out to be "" (when I have to exclude anything).&lt;/P&gt;</description>
      <pubDate>Sun, 22 Aug 2021 15:47:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-calculation-does-not-work-using-variable-row-context-issue-or/m-p/2030477#M45527</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2021-08-22T15:47:30Z</dc:date>
    </item>
  </channel>
</rss>

