<?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 through a related table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2397941#M62622</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I forgot to tell that in thid measure&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Total],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RELATEDTABLE&lt;/SPAN&gt;&lt;SPAN&gt;(&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Partners&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;/SPAN&gt;the [Total] is a calculated sum with userelationship of dates.&lt;BR /&gt;Also, my report has none dates filter or values. It's a report based on the sum of everything.&lt;BR /&gt;And i don't need to stablish any relationship....&lt;BR /&gt;Kinda weird solution, no?&lt;BR /&gt;About those measures above, don't you think the 2nd is faster than the first and then yours?&lt;BR /&gt;Also, i've done a new matrix visual, with any measure, from simple to less simple measure and the result is the same.&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Wed, 16 Mar 2022 12:30:45 GMT</pubDate>
    <dc:creator>pedroccamaraDBI</dc:creator>
    <dc:date>2022-03-16T12:30:45Z</dc:date>
    <item>
      <title>Calculate through a related table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2397559#M62609</link>
      <description>&lt;P&gt;Hi guys,&lt;BR /&gt;I hope everyone's ok.&lt;BR /&gt;I'm building a matrix visual that shows me by for each type of policy, the total by 4 levels, Company, cost center, product and partner.&lt;BR /&gt;All these columns are in the same table, policies, except the partner which is in partners table, connected actively with policies.&lt;BR /&gt;I want to calculate the sum of values for each level and i came up with these measures:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&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;[Total]&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;Partners&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TREATAS&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;Partners[ContractID]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;'Policies'[ContractID]&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt; ))&lt;BR /&gt;which works but i believe it's taking to long to calculate and sometimes gives me this error, and then it goes away.&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;Then i came up with another measure, which also is taking to long to calculate:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Total],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RELATEDTABLE&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;Partners&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;BR /&gt;Can you help me on what is the best measure for this one?&lt;BR /&gt;Thank you all very much&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 09:54:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2397559#M62609</guid>
      <dc:creator>pedroccamaraDBI</dc:creator>
      <dc:date>2022-03-16T09:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate through a related table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2397581#M62611</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240828" data-lia-user-login="pedroccamaraDBI" class="lia-mention lia-mention-user"&gt;pedroccamaraDBI&lt;/a&gt; , if policies table is connected with a partner then why the need of these filters &lt;/P&gt;
&lt;P&gt;you can check for non blank&lt;/P&gt;
&lt;P&gt;CALCULATE([Total],&lt;BR /&gt;filter(Partners, not(isblank(Partners[ContractID] ))) &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this does not help&lt;BR /&gt;Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 09:58:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2397581#M62611</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-03-16T09:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate through a related table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2397818#M62616</link>
      <description>&lt;P&gt;That is exactly my point&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I wouldn't need any filter.&amp;nbsp;&lt;BR /&gt;This table is connected to another table (which doesn't matter because i don't have any measure or column from it) but it's also connected with Dates table with an inactive connection. This also shouldn't matter...&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;Can you come up with any other measure solution?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 10:54:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2397818#M62616</guid>
      <dc:creator>pedroccamaraDBI</dc:creator>
      <dc:date>2022-03-16T10:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate through a related table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2397828#M62617</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240828" data-lia-user-login="pedroccamaraDBI" class="lia-mention lia-mention-user"&gt;pedroccamaraDBI&lt;/a&gt; , Assume you are using table Fact and the fall in filter direction of Dim1 , Dim2 via dim 3, then all these dim should filter fact. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is inactive join and you can not active that using userelationship&lt;/P&gt;
&lt;P&gt;you can push that to filter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//Date1 is independent Date table or inactive join&amp;nbsp; &lt;BR /&gt;new measure =&lt;BR /&gt;var _max = maxx(allselected(Date1),Date1[Date])&lt;BR /&gt;var _min = MINX(allselected(Date1),Date1[Date]) &lt;BR /&gt;return &lt;BR /&gt;calculate( sum(Table[Value]), filter('Table', 'Table'[Date] &amp;gt;=_min &amp;amp;&amp;amp; 'Table'[Date] &amp;lt;=_max))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this does not help&lt;BR /&gt;Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 10:59:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2397828#M62617</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-03-16T10:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate through a related table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2397941#M62622</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I forgot to tell that in thid measure&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Total],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RELATEDTABLE&lt;/SPAN&gt;&lt;SPAN&gt;(&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Partners&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;/SPAN&gt;the [Total] is a calculated sum with userelationship of dates.&lt;BR /&gt;Also, my report has none dates filter or values. It's a report based on the sum of everything.&lt;BR /&gt;And i don't need to stablish any relationship....&lt;BR /&gt;Kinda weird solution, no?&lt;BR /&gt;About those measures above, don't you think the 2nd is faster than the first and then yours?&lt;BR /&gt;Also, i've done a new matrix visual, with any measure, from simple to less simple measure and the result is the same.&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 16 Mar 2022 12:30:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2397941#M62622</guid>
      <dc:creator>pedroccamaraDBI</dc:creator>
      <dc:date>2022-03-16T12:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate through a related table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2398163#M62634</link>
      <description>&lt;P&gt;Another thing&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;My model as the image above: I have this policies table, one line per policy number. It is a unique table by policies. This table is connected with Dates with an inactive relation between dates. The policies table is connected with partners table, one to many, because you can have several type of partners for each policy number. Types of partner? Seller, manager, mediator, etc.&lt;BR /&gt;My visual doesn't have any date nor as a filter. My report has a filter that allow us to choose the type of partner, but is always sellected to seller. You're suppose to be able to change it.&lt;BR /&gt;My main measure above, Total, is a simple calculate with sum of total column with userelationship between dates.&lt;BR /&gt;Now the measure that i need, all 3 above works fine but they're taking to long to calculate and i believe the reason why my pbi file is almost 30MB.&amp;nbsp;&lt;BR /&gt;The main question: what this measure would have to be like in order to be faster?&lt;BR /&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 13:21:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2398163#M62634</guid>
      <dc:creator>pedroccamaraDBI</dc:creator>
      <dc:date>2022-03-16T13:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate through a related table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2398356#M62641</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240828" data-lia-user-login="pedroccamaraDBI" class="lia-mention lia-mention-user"&gt;pedroccamaraDBI&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can try&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Partners Total =
CALCULATE (
    [Total],
    CROSSFILTER ( Partners[ContractID], 'Policies'[ContractID], BOTH )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 16 Mar 2022 14:24:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2398356#M62641</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-16T14:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate through a related table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2398653#M62650</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Great idea and many thanks for your help.&lt;BR /&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 15:52:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-through-a-related-table/m-p/2398653#M62650</guid>
      <dc:creator>pedroccamaraDBI</dc:creator>
      <dc:date>2022-03-16T15:52:24Z</dc:date>
    </item>
  </channel>
</rss>

