<?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 All Except is not behaving correctly on PBI in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/All-Except-is-not-behaving-correctly-on-PBI/m-p/3127901#M111183</link>
    <description>&lt;P&gt;just noticed wrong calcuation by PBI after latest SW version, here is dummy table and DAX expression i tried on excel and it worked perfectly fine and tried on PBI but not giving the correct results.&lt;BR /&gt;the measure i created on excel &amp;amp; PBI is :&lt;!--   StartFragment    --&gt;&lt;SPAN class=""&gt;measure 1:=&lt;/SPAN&gt;&lt;SPAN class=""&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;SUM&lt;/SPAN&gt;&lt;SPAN class=""&gt;(Table1[Sales]),&lt;/SPAN&gt;&lt;SPAN class=""&gt;ALLEXCEPT&lt;/SPAN&gt;&lt;SPAN class=""&gt;(Table1,Table1[Category],Table1[Month])),&lt;/SPAN&gt;&lt;SPAN class=""&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;SUM&lt;/SPAN&gt;&lt;SPAN class=""&gt;(Table1[Sales]),&lt;/SPAN&gt;&lt;SPAN class=""&gt;ALLEXCEPT&lt;/SPAN&gt;&lt;SPAN class=""&gt;(Table1,Table1[Month])))&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;!--   EndFragment    --&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;the table&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Month&lt;/TD&gt;&lt;TD&gt;Category&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jan-23&lt;/TD&gt;&lt;TD&gt;Books&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jan-23&lt;/TD&gt;&lt;TD&gt;Pens&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jan-23&lt;/TD&gt;&lt;TD&gt;Cards&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Feb-23&lt;/TD&gt;&lt;TD&gt;Books&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Feb-23&lt;/TD&gt;&lt;TD&gt;Cards&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Mar-23&lt;/TD&gt;&lt;TD&gt;Books&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Mar-23&lt;/TD&gt;&lt;TD&gt;Cards&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;i created 2 slicers (month &amp;amp; category) where i expected sales values for &lt;STRONG&gt;selected&lt;/STRONG&gt; &lt;STRONG&gt;category&lt;/STRONG&gt; in the &lt;STRONG&gt;selected months&lt;/STRONG&gt; to be divided by&amp;nbsp;&lt;BR /&gt;sales values of&lt;STRONG&gt; all categories&lt;/STRONG&gt; in the selected months, however it only works when im clearing the months selection despite the fact that its working 100% accurate in excel.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2023 12:17:11 GMT</pubDate>
    <dc:creator>Zaytoon</dc:creator>
    <dc:date>2023-03-13T12:17:11Z</dc:date>
    <item>
      <title>All Except is not behaving correctly on PBI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/All-Except-is-not-behaving-correctly-on-PBI/m-p/3127901#M111183</link>
      <description>&lt;P&gt;just noticed wrong calcuation by PBI after latest SW version, here is dummy table and DAX expression i tried on excel and it worked perfectly fine and tried on PBI but not giving the correct results.&lt;BR /&gt;the measure i created on excel &amp;amp; PBI is :&lt;!--   StartFragment    --&gt;&lt;SPAN class=""&gt;measure 1:=&lt;/SPAN&gt;&lt;SPAN class=""&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;SUM&lt;/SPAN&gt;&lt;SPAN class=""&gt;(Table1[Sales]),&lt;/SPAN&gt;&lt;SPAN class=""&gt;ALLEXCEPT&lt;/SPAN&gt;&lt;SPAN class=""&gt;(Table1,Table1[Category],Table1[Month])),&lt;/SPAN&gt;&lt;SPAN class=""&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;SUM&lt;/SPAN&gt;&lt;SPAN class=""&gt;(Table1[Sales]),&lt;/SPAN&gt;&lt;SPAN class=""&gt;ALLEXCEPT&lt;/SPAN&gt;&lt;SPAN class=""&gt;(Table1,Table1[Month])))&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;!--   EndFragment    --&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;the table&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Month&lt;/TD&gt;&lt;TD&gt;Category&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jan-23&lt;/TD&gt;&lt;TD&gt;Books&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jan-23&lt;/TD&gt;&lt;TD&gt;Pens&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jan-23&lt;/TD&gt;&lt;TD&gt;Cards&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Feb-23&lt;/TD&gt;&lt;TD&gt;Books&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Feb-23&lt;/TD&gt;&lt;TD&gt;Cards&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Mar-23&lt;/TD&gt;&lt;TD&gt;Books&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Mar-23&lt;/TD&gt;&lt;TD&gt;Cards&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;i created 2 slicers (month &amp;amp; category) where i expected sales values for &lt;STRONG&gt;selected&lt;/STRONG&gt; &lt;STRONG&gt;category&lt;/STRONG&gt; in the &lt;STRONG&gt;selected months&lt;/STRONG&gt; to be divided by&amp;nbsp;&lt;BR /&gt;sales values of&lt;STRONG&gt; all categories&lt;/STRONG&gt; in the selected months, however it only works when im clearing the months selection despite the fact that its working 100% accurate in excel.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 12:17:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/All-Except-is-not-behaving-correctly-on-PBI/m-p/3127901#M111183</guid>
      <dc:creator>Zaytoon</dc:creator>
      <dc:date>2023-03-13T12:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: All Except is not behaving correctly on PBI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/All-Except-is-not-behaving-correctly-on-PBI/m-p/3129137#M111268</link>
      <description>&lt;P&gt;Do you create separate tables for the slicer columns or do you use the columns from &lt;SPAN&gt;Table1&lt;/SPAN&gt;? It seems that you have this problem:&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/understanding-dax-auto-exist/" target="_blank"&gt;https://www.sqlbi.com/articles/understanding-dax-auto-exist/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 20:16:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/All-Except-is-not-behaving-correctly-on-PBI/m-p/3129137#M111268</guid>
      <dc:creator>andhiii079845</dc:creator>
      <dc:date>2023-03-13T20:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: All Except is not behaving correctly on PBI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/All-Except-is-not-behaving-correctly-on-PBI/m-p/3130191#M111335</link>
      <description>&lt;P&gt;Thanks andhiii079845 actually slicers are from the same table&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 08:38:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/All-Except-is-not-behaving-correctly-on-PBI/m-p/3130191#M111335</guid>
      <dc:creator>Zaytoon</dc:creator>
      <dc:date>2023-03-14T08:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: All Except is not behaving correctly on PBI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/All-Except-is-not-behaving-correctly-on-PBI/m-p/3130200#M111337</link>
      <description>&lt;P&gt;Yes than you have the probem. You will filter the table with a slicer before the other calculations, ALL() will not help you in this case. Please create a separate table with DISTINCT values of the columns for the slicer and use this column in your table. You can create a relation between both tables.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 08:43:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/All-Except-is-not-behaving-correctly-on-PBI/m-p/3130200#M111337</guid>
      <dc:creator>andhiii079845</dc:creator>
      <dc:date>2023-03-14T08:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: All Except is not behaving correctly on PBI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/All-Except-is-not-behaving-correctly-on-PBI/m-p/3130470#M111360</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="499156" data-lia-user-login="Zaytoon" class="lia-mention lia-mention-user"&gt;Zaytoon&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Indeed Power Pivot and Power Bi DAX engines are different and they somethimes behave differently. With Power Bi measure it is recommended to use&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;1 =
DIVIDE (
    CALCULATE (
        SUM ( Table1[Sales] ),
        ALL ( Table1 ),
        VALUES ( Table1[Category] ),
        VALUES ( Table1[Month] )
    ),
    CALCULATE ( SUM ( Table1[Sales] ), ALL ( Table1 ), VALUES ( Table1[Month] ) )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 14 Mar 2023 10:41:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/All-Except-is-not-behaving-correctly-on-PBI/m-p/3130470#M111360</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-14T10:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: All Except is not behaving correctly on PBI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/All-Except-is-not-behaving-correctly-on-PBI/m-p/3130664#M111383</link>
      <description>&lt;P&gt;It looks like there might be an issue with the context being used in your DAX expression. The ALLEXCEPT function is removing filters from all columns except for the specified ones, which may not be what you want in this case.&lt;/P&gt;&lt;P&gt;Instead, you could try using the FILTER function to explicitly filter the table based on the selected month and category, and then calculate the numerator and denominator separately. Here is an example of what the DAX expression could look like:&lt;/P&gt;&lt;P&gt;measure 1 := VAR selected_month = SELECTEDVALUE(Table1[Month]) VAR selected_category = SELECTEDVALUE(Table1[Category]) VAR numerator = CALCULATE( SUM(Table1[Sales]), Table1[Month] = selected_month, LEFT(Table1[Category], 2) = IF(selected_category = "All", LEFT(Table1[Category], 2), LEFT(selected_category, 2)) ) VAR denominator = CALCULATE( SUM(Table1[Sales]), Table1[Month] = selected_month, ALL(Table1[Category]) ) RETURN DIVIDE(numerator, denominator)&lt;/P&gt;&lt;P&gt;This expression uses the LEFT function to extract the first two characters of the Category column, which should match the prefixes used in your original logic. It also checks if the selected category is "All", in which case it includes all categories that have the same prefix as the selected month.&lt;/P&gt;&lt;P&gt;Let me know if this helps or if you have any further questions!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 12:19:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/All-Except-is-not-behaving-correctly-on-PBI/m-p/3130664#M111383</guid>
      <dc:creator>Adamboer</dc:creator>
      <dc:date>2023-03-14T12:19:12Z</dc:date>
    </item>
  </channel>
</rss>

