<?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 $Expr0 := CallbackDataID in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expr0-CallbackDataID/m-p/1882836#M40481</link>
    <description>&lt;P&gt;The following code is rewritten to eliminate the callbackdataid but it increased SE Queries and decreased SE Cache and overall performance degraded. Is callbackdataid good or bad,&amp;nbsp; Is this the correct method to eliminate callbackdataid? Why performance is degraded?&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;BR /&gt;SUMX(FILTER('AccountTransactions',(RELATED(Accounts[Account Group])=1 || RELATED(Accounts[Account Group])=2)),&lt;BR /&gt;if(RELATED(Accounts[Account Group])=1,[Debit]-[Credit],[Credit]-[Debit])),&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;FILTER (&lt;BR /&gt;ALL ( Dates[Date] ),&lt;BR /&gt;Dates[Date]&amp;lt;= MAX ( 'Dates'[Date])&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;---------------new code to eliminate callbackdataid&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;BR /&gt;SUMX(FILTER('AccountTransactions',RELATED(Accounts[Account Group])=1),&lt;BR /&gt;[Debit]-[Credit]),&lt;/P&gt;&lt;P&gt;FILTER (&lt;BR /&gt;ALL ( Dates[Date] ),&lt;BR /&gt;Dates[Date]&amp;lt;= MAX ( 'Dates'[Date])&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;+&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUMX(FILTER('AccountTransactions',RELATED(Accounts[Account Group])=2),&lt;BR /&gt;[Credit]-[Debit]),&lt;/P&gt;&lt;P&gt;FILTER (&lt;BR /&gt;ALL ( Dates[Date] ),&lt;BR /&gt;Dates[Date]&amp;lt;= MAX ( 'Dates'[Date])&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Fri, 04 Jun 2021 19:08:04 GMT</pubDate>
    <dc:creator>hari127</dc:creator>
    <dc:date>2021-06-04T19:08:04Z</dc:date>
    <item>
      <title>$Expr0 := CallbackDataID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expr0-CallbackDataID/m-p/1882836#M40481</link>
      <description>&lt;P&gt;The following code is rewritten to eliminate the callbackdataid but it increased SE Queries and decreased SE Cache and overall performance degraded. Is callbackdataid good or bad,&amp;nbsp; Is this the correct method to eliminate callbackdataid? Why performance is degraded?&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;BR /&gt;SUMX(FILTER('AccountTransactions',(RELATED(Accounts[Account Group])=1 || RELATED(Accounts[Account Group])=2)),&lt;BR /&gt;if(RELATED(Accounts[Account Group])=1,[Debit]-[Credit],[Credit]-[Debit])),&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;FILTER (&lt;BR /&gt;ALL ( Dates[Date] ),&lt;BR /&gt;Dates[Date]&amp;lt;= MAX ( 'Dates'[Date])&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;---------------new code to eliminate callbackdataid&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;BR /&gt;SUMX(FILTER('AccountTransactions',RELATED(Accounts[Account Group])=1),&lt;BR /&gt;[Debit]-[Credit]),&lt;/P&gt;&lt;P&gt;FILTER (&lt;BR /&gt;ALL ( Dates[Date] ),&lt;BR /&gt;Dates[Date]&amp;lt;= MAX ( 'Dates'[Date])&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;+&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUMX(FILTER('AccountTransactions',RELATED(Accounts[Account Group])=2),&lt;BR /&gt;[Credit]-[Debit]),&lt;/P&gt;&lt;P&gt;FILTER (&lt;BR /&gt;ALL ( Dates[Date] ),&lt;BR /&gt;Dates[Date]&amp;lt;= MAX ( 'Dates'[Date])&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 19:08:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expr0-CallbackDataID/m-p/1882836#M40481</guid>
      <dc:creator>hari127</dc:creator>
      <dc:date>2021-06-04T19:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: $Expr0 := CallbackDataID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expr0-CallbackDataID/m-p/1882887#M40484</link>
      <description>&lt;P&gt;Performance tuning is highly situational. Eliminating callbackdataid isn't always a good idea. It depends. Your second version requires iterating through 'AccountTransaction' twice instead of just once.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure this will work but it may give you an idea of another path to try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALCULATE (
    CALCULATE ( [Debit] - [Credit], Accounts[Account Group] = 1 ) +
    CALCULATE ( [Credit] - [Debit], Accounts[Account Group] = 2 ),
    FILTER ( ALL ( Dates[Date] ), Dates[Date] &amp;lt;= MAX ( 'Dates'[Date] ) )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 20:07:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expr0-CallbackDataID/m-p/1882887#M40484</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2021-06-04T20:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: $Expr0 := CallbackDataID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expr0-CallbackDataID/m-p/1883199#M40500</link>
      <description>&lt;P&gt;Thank you very much for the support. The following are the results using three difference versions&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;BR /&gt;SUMX(FILTER('AccountTransactions',(RELATED(Accounts[Account Group])=1 || RELATED(Accounts[Account Group])=2)),&lt;BR /&gt;if(RELATED(Accounts[Account Group])=1,[Debit]-[Credit],[Credit]-[Debit])),&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;FILTER (&lt;BR /&gt;ALL ( Dates[Date] ),&lt;BR /&gt;Dates[Date]&amp;lt;= MAX ( 'Dates'[Date])&lt;BR /&gt;)&lt;BR /&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;CALCULATE(&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUMX(FILTER('AccountTransactions',RELATED(Accounts[Account Group])=1),&lt;BR /&gt;[Debit]-[Credit])&lt;BR /&gt;)&lt;BR /&gt;+&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUMX(FILTER('AccountTransactions',RELATED(Accounts[Account Group])=2),&lt;BR /&gt;[Credit]-[Debit])),&lt;/P&gt;&lt;P&gt;FILTER (&lt;BR /&gt;ALL ( Dates[Date] ),&lt;BR /&gt;Dates[Date]&amp;lt;= MAX ( 'Dates'[Date])&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Made changes to the model to include account group in the same table&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUMX(FILTER('AccountTransactions',[Account Group]=1),&lt;BR /&gt;[Debit]-[Credit])&lt;BR /&gt;)&lt;BR /&gt;+&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUMX(FILTER('AccountTransactions',[Account Group]=2),&lt;BR /&gt;[Credit]-[Debit])),&lt;/P&gt;&lt;P&gt;FILTER (&lt;BR /&gt;ALL ( Dates[Date] ),&lt;BR /&gt;Dates[Date]&amp;lt;= MAX ( 'Dates'[Date])&lt;BR /&gt;)&lt;BR /&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;</description>
      <pubDate>Sat, 05 Jun 2021 05:57:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expr0-CallbackDataID/m-p/1883199#M40500</guid>
      <dc:creator>hari127</dc:creator>
      <dc:date>2021-06-05T05:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: $Expr0 := CallbackDataID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expr0-CallbackDataID/m-p/1883409#M40524</link>
      <description>&lt;P&gt;&lt;STRONG&gt;If you want to have fast DAX, then never ever call a measure when iterating a fact table row by row.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2021 16:23:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expr0-CallbackDataID/m-p/1883409#M40524</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2021-06-05T16:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: $Expr0 := CallbackDataID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expr0-CallbackDataID/m-p/1883705#M40540</link>
      <description>&lt;P&gt;Did you find any measure in my code?&lt;/P&gt;</description>
      <pubDate>Sun, 06 Jun 2021 08:42:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expr0-CallbackDataID/m-p/1883705#M40540</guid>
      <dc:creator>hari127</dc:creator>
      <dc:date>2021-06-06T08:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: $Expr0 := CallbackDataID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expr0-CallbackDataID/m-p/1883815#M40547</link>
      <description>&lt;P&gt;I use &lt;A href="https://www.sqlbi.com/articles/rules-for-dax-code-formatting/" target="_blank" rel="noopener"&gt;THESE&lt;/A&gt; conventions to interpret DAX code when I read it. If you don't follow this &lt;STRONG&gt;golden standard&lt;/STRONG&gt;, then you should not be surprised that people do not understand your code.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Jun 2021 14:36:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expr0-CallbackDataID/m-p/1883815#M40547</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2021-06-06T14:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: $Expr0 := CallbackDataID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expr0-CallbackDataID/m-p/1883859#M40559</link>
      <description>&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 06 Jun 2021 16:25:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expr0-CallbackDataID/m-p/1883859#M40559</guid>
      <dc:creator>hari127</dc:creator>
      <dc:date>2021-06-06T16:25:21Z</dc:date>
    </item>
  </channel>
</rss>

