<?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: Calculate not working when using same field in  table and formula filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-not-working-when-using-same-field-in-table-and-formula/m-p/1989938#M44004</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="303333" data-lia-user-login="AndreaLorenzo" class="lia-mention lia-mention-user"&gt;AndreaLorenzo&lt;/a&gt;&amp;nbsp;That's pretty much exactly how I would have done it.&lt;/P&gt;</description>
    <pubDate>Fri, 30 Jul 2021 15:02:58 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2021-07-30T15:02:58Z</dc:date>
    <item>
      <title>Calculate not working when using same field in  table and formula filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-not-working-when-using-same-field-in-table-and-formula/m-p/1987360#M43920</link>
      <description>&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to do something very simple, but I can't make it work:&amp;nbsp; from a Sales table, I need to compare the revenue for every product category related to another one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've&amp;nbsp; created two colums:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Total Sales= SUM(PBI_Sales[Revenue))&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;H Revenue= CALCULATE([Total Sales]; PBI_Products[Category]="H")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting this table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if I dont use Product Category in the table, it works and filters by sales of that product:&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;Is there something I'm missing? I've checked my table relantionships as well, and there's 1-N from Products to Sales, nothing weird.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be appreciated!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Kind regars&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 12:42:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-not-working-when-using-same-field-in-table-and-formula/m-p/1987360#M43920</guid>
      <dc:creator>AndreaLorenzo</dc:creator>
      <dc:date>2021-07-29T12:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate not working when using same field in  table and formula filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-not-working-when-using-same-field-in-table-and-formula/m-p/1987368#M43921</link>
      <description>&lt;P&gt;Sorry, I forgot to say that my problem is that I don't know why the "H revenue" value is not showing for every row, only for the matching criteria product...&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 12:45:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-not-working-when-using-same-field-in-table-and-formula/m-p/1987368#M43921</guid>
      <dc:creator>AndreaLorenzo</dc:creator>
      <dc:date>2021-07-29T12:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate not working when using same field in  table and formula filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-not-working-when-using-same-field-in-table-and-formula/m-p/1987378#M43922</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="303333" data-lia-user-login="AndreaLorenzo" class="lia-mention lia-mention-user"&gt;AndreaLorenzo&lt;/a&gt;&amp;nbsp;You are running into &lt;A href="https://community.powerbi.com/t5/Community-Blog/CALCUHATE-Why-I-Don-t-Use-DAX-s-CALCULATE-Function/ba-p/1248635" target="_self"&gt;yet another reason I don't use CALCULATE&lt;/A&gt;. Basically, if you use CALCULATE with a straight filter clause (no FILTER function) then if the column you specify is already in the filter context, it replaces the filter context for that column. Otherwise, it adds to the filter context.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/dax/calculate-function-dax" target="_blank"&gt;CALCULATE function (DAX) - DAX | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's hard to tell because I don't know your source data but it is probably something along those lines. As a general rule, if a function needs 50 blog articles to explain how it works, I tend to avoid it.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 12:48:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-not-working-when-using-same-field-in-table-and-formula/m-p/1987378#M43922</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-07-29T12:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate not working when using same field in  table and formula filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-not-working-when-using-same-field-in-table-and-formula/m-p/1989627#M43993</link>
      <description>&lt;P&gt;Thanks for the feedback,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;. Calculate is a bit difficult to understand, yes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I finally got it working, maybe is not the most elegant solution, but it will do...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;H_Sales= var _tbl = ALLSELECTED(PBI_Sales)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var _catFiler= "H"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RETURN SUMX(FILTER(_tbl;&amp;nbsp; PBI_Sales[CategoryID]=_catFilter); [Revenue])&lt;/SPAN&gt;&lt;/PRE&gt;&lt;DIV&gt;Thanks!&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 30 Jul 2021 11:40:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-not-working-when-using-same-field-in-table-and-formula/m-p/1989627#M43993</guid>
      <dc:creator>AndreaLorenzo</dc:creator>
      <dc:date>2021-07-30T11:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate not working when using same field in  table and formula filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-not-working-when-using-same-field-in-table-and-formula/m-p/1989938#M44004</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="303333" data-lia-user-login="AndreaLorenzo" class="lia-mention lia-mention-user"&gt;AndreaLorenzo&lt;/a&gt;&amp;nbsp;That's pretty much exactly how I would have done it.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2021 15:02:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-not-working-when-using-same-field-in-table-and-formula/m-p/1989938#M44004</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-07-30T15:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate not working when using same field in  table and formula filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-not-working-when-using-same-field-in-table-and-formula/m-p/1990089#M44018</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="303333" data-lia-user-login="AndreaLorenzo" class="lia-mention lia-mention-user"&gt;AndreaLorenzo&lt;/a&gt;&amp;nbsp;From what table is coming the column "Prod Cat" on your table. Is it from the Product table?&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2021 16:08:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-not-working-when-using-same-field-in-table-and-formula/m-p/1990089#M44018</guid>
      <dc:creator>m3tr01d</dc:creator>
      <dc:date>2021-07-30T16:08:30Z</dc:date>
    </item>
  </channel>
</rss>

