<?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: SUMX with additional conditions in SSAS tabular in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-with-additional-conditions-in-SSAS-tabular/m-p/1905231#M41128</link>
    <description>&lt;P&gt;Why are you using OR in here&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FILTER(Channels,&lt;STRONG&gt;OR&lt;/STRONG&gt;([channel]="Affiliate",[channel]="facebook"))) ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Try with the formula I mentioned and if it is still not working then please cross check your data once.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;See if data is filtered for that particlar field.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also if you could share the data and the output you need, then I can see and tell.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sanket Bhagwat&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Jun 2021 05:28:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-06-17T05:28:19Z</dc:date>
    <item>
      <title>SUMX with additional conditions in SSAS tabular</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-with-additional-conditions-in-SSAS-tabular/m-p/1903272#M41056</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have to prepare calculation like:&lt;/P&gt;&lt;P&gt;case when&amp;nbsp;[perfo cost]/[sales net]&amp;gt;[bdg cos %] and date&amp;gt;='2021-06-01' and channel in ('facebook', 'affiliate') then&amp;nbsp;[sales net]*[bdg cos %] else 'perfo cost' end as&amp;nbsp;cost attribution&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what i have now:&lt;/P&gt;&lt;P&gt;cost attribution = SUMX(VALUES('Calendar'), if([perfo cost]/[sales net]&amp;gt;[bdg cos %] &amp;amp;&amp;amp; min(Calendar[DateID])&amp;gt;=20210601,[sales net]*[bdg cos %],[perfo cost]))&lt;BR /&gt;I used SUMX because i got incorrect result in total. It works well for all data but I need calculate it only for channel facebook and affiliate.&lt;/P&gt;&lt;P&gt;I tried few options:&lt;/P&gt;&lt;P&gt;SUMX(VALUES('Calendar'), if([perfo cost]/[sales net]&amp;gt;[bdg cos %] &amp;amp;&amp;amp; min(Calendar[DateID])&amp;gt;=20210601 &amp;amp;&amp;amp; (MIN([Channel])='facebook' || MIN([Channel])='affiliate')&amp;nbsp;,[sales net]*[bdg cos %],[perfo cost]))&lt;BR /&gt;but it works only if i have filtered channel in Report. If i clean channel filter condition doesn't work for all data and i get incorrect total sum.&lt;/P&gt;&lt;P&gt;SUMX(VALUES('Calendar'), if(CALCULATE([perfo cost]/[sales net]&amp;gt;[bdg cos %] &amp;amp;&amp;amp; min(Calendar[DateID])&amp;gt;=20210601,FILTER('Channels',OR([Channel]='facebook',[Channel]='affiliate'))),[sales net]*[bdg cos %],[perfo cost]))&lt;/P&gt;&lt;P&gt;it works well when i have filtered Channel. When i Clean channel filter Condition&amp;nbsp;[sales net]*[bdg cos %] works for all data (not only facebook and affiliate) and also i get wrong total sum.&lt;BR /&gt;So i don't know how to put condition for channels that will be not sensitive for Channel Filter in Report.&lt;/P&gt;&lt;P&gt;Thank for help&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 08:54:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-with-additional-conditions-in-SSAS-tabular/m-p/1903272#M41056</guid>
      <dc:creator>R0bson</dc:creator>
      <dc:date>2021-06-16T08:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX with additional conditions in SSAS tabular</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-with-additional-conditions-in-SSAS-tabular/m-p/1903420#M41060</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="190638" data-lia-user-login="R0bson" class="lia-mention lia-mention-user"&gt;R0bson&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;You can add a FILTER statemen at the end of the DAX.&lt;/P&gt;&lt;P&gt;You can write like ,FILTER(Channels,[channel]="Affiliate" &amp;amp;&amp;amp; [channel]="facebook").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sanket Bhagwat.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this answers your question, then please do mark it as "Accept as Solution' so that other members could find it easily.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 09:28:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-with-additional-conditions-in-SSAS-tabular/m-p/1903420#M41060</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-16T09:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX with additional conditions in SSAS tabular</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-with-additional-conditions-in-SSAS-tabular/m-p/1903576#M41072</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;SanketBhagwat,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for reply, you are taking about:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE(SUMX(VALUES('Calendar'), if([perfo cost]/[sales net]&amp;gt;[bdg cos %] &amp;amp;&amp;amp; min(Calendar[DateID])&amp;gt;=20210601,[sales net]*[bdg cos %],[perfo cost])),FILTER(Channels,OR([channel]="Affiliate",[channel]="facebook")))&amp;nbsp; ??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It works only if i have filtered channel Affiliate or facebook, for Others Channel i have null values. If i clean channel filter i get total sum with only affiliate and facebook values.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 10:29:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-with-additional-conditions-in-SSAS-tabular/m-p/1903576#M41072</guid>
      <dc:creator>R0bson</dc:creator>
      <dc:date>2021-06-16T10:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX with additional conditions in SSAS tabular</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-with-additional-conditions-in-SSAS-tabular/m-p/1905231#M41128</link>
      <description>&lt;P&gt;Why are you using OR in here&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FILTER(Channels,&lt;STRONG&gt;OR&lt;/STRONG&gt;([channel]="Affiliate",[channel]="facebook"))) ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Try with the formula I mentioned and if it is still not working then please cross check your data once.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;See if data is filtered for that particlar field.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also if you could share the data and the output you need, then I can see and tell.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sanket Bhagwat&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 05:28:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-with-additional-conditions-in-SSAS-tabular/m-p/1905231#M41128</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-17T05:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX with additional conditions in SSAS tabular</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-with-additional-conditions-in-SSAS-tabular/m-p/1905503#M41135</link>
      <description>&lt;P&gt;it gives null values for all data:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE(SUMX(VALUES('Calendar'), if([perfo cost]/[sales net]&amp;gt;[bdg cos %] &amp;amp;&amp;amp; min(Calendar[DateID])&amp;gt;=20210601,[sales net]*[bdg cos %],[perfo cost])),FILTER(Channels,([channel]="Affiliate" &amp;amp;&amp;amp;[channel]="facebook")))&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I also tried with formula:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SUMX(SUMMARIZE(VALUES('Channels'),'Channels'[Channel] ,"AD", if([perfo cost]/[sales net]&amp;gt;[bdg cos %] &amp;amp;&amp;amp; min(Calendar[DateID])&amp;gt;=20210601 &amp;amp;&amp;amp; (MIN('Channels'[Channel])="Facebook" || MIN('Channels'[Channel])="Affiliate"),[sales net]*[bdg cos %],[perfo cost]),"FK",[perfo cost]),MIN([AD],[FK]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It works correct for all data when i have filtered date &amp;gt;= 20210601, when i have include earlier dates total sum is wrong.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 07:27:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-with-additional-conditions-in-SSAS-tabular/m-p/1905503#M41135</guid>
      <dc:creator>R0bson</dc:creator>
      <dc:date>2021-06-17T07:27:54Z</dc:date>
    </item>
  </channel>
</rss>

