<?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: ALLEXCEPT behaviour in one to many relationship in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1443061#M27017</link>
    <description>removefilters( T[Col] ) = all( T[Col] )</description>
    <pubDate>Mon, 19 Oct 2020 21:05:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-10-19T21:05:34Z</dc:date>
    <item>
      <title>ALLEXCEPT behaviour in one to many relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1441811#M26972</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two tables: A and B. A is a fact table with columns: PlayerId, GameID, Category. B is with columns: Game_id, Game_Name.&lt;/P&gt;&lt;P&gt;A and B have one to many relationship.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i need is total players by game regardless of the category.&lt;/P&gt;&lt;P&gt;I am really struggling making this working:&lt;/P&gt;&lt;P&gt;CALCULATE ( DistinctCount(TableA[PlayerId]) , ALLEXCEPT ( TableB, TableB[Game_Name] ) )&lt;/P&gt;&lt;P&gt;The result of this is total pLayers by game and category.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to make this measure working the way i need?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 11:09:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1441811#M26972</guid>
      <dc:creator>ivanmezev</dc:creator>
      <dc:date>2020-10-19T11:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: ALLEXCEPT behaviour in one to many relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1442404#M26990</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="208948" data-lia-user-login="ivanmezev" class="lia-mention lia-mention-user"&gt;ivanmezev&lt;/a&gt; -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How are you visualizing the output (card, matrix, etc)? Do you have slicers for category, game? Are there any other tables in your model that could be holding onto a filter?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can provide some sample data as well it would make it easier to answer your question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 14:26:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1442404#M26990</guid>
      <dc:creator>dedelman_clng</dc:creator>
      <dc:date>2020-10-19T14:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: ALLEXCEPT behaviour in one to many relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1442656#M26994</link>
      <description>&lt;P&gt;This is your measure:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;DistinctCount( TableA[PlayerId] )&lt;/LI-CODE&gt;&lt;P&gt;It's enough to drop your game names onto a table/matrix and drop this measure onto it as well. You'll get the number of players for each game regardless of the category. If you drop categories onto the visual, you'll get the number of players by game and category.&lt;BR /&gt;&lt;BR /&gt;If you want a measure that will always disregard the categories, then you should use this measure:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;calculate(
    distinctcount( TableA[PlayerID] ),
    removefilters( TableA[Category] )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 16:07:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1442656#M26994</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-19T16:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: ALLEXCEPT behaviour in one to many relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1442870#M27009</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13353" data-lia-user-login="dedelman_clng" class="lia-mention lia-mention-user"&gt;dedelman_clng&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My model is in Analysis Services. Dim_Games is connected with the Fact table through game_id, the relationship is 1 to many.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything is coming from the fact except game_name. What i am trying to achieve is to calculate % of Total&amp;nbsp; by category for a certain game. For the purpose i use this formula:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Distinct Players:= DISTINCTCOUNT(fact[player_id])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Players All:= CALCULATE([Distinct Players], ALLEXCEPT(dim_games, dim_games[game_name]))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Result:= [Distinct Players]/[Players All]&lt;/LI-CODE&gt;&lt;P&gt;I just can't make the second part of the expression working. ALLEXCEPT returns different number for each category where it should be the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output is visualized in a Matrix: Game_Name, Category, % of Total.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only slicer is for game_name.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 18:31:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1442870#M27009</guid>
      <dc:creator>ivanmezev</dc:creator>
      <dc:date>2020-10-19T18:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: ALLEXCEPT behaviour in one to many relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1442876#M27010</link>
      <description>&lt;P&gt;hi&amp;nbsp;Anonymous&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately i can't use removefilters when the model is in Analysis.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 18:34:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1442876#M27010</guid>
      <dc:creator>ivanmezev</dc:creator>
      <dc:date>2020-10-19T18:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: ALLEXCEPT behaviour in one to many relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1443061#M27017</link>
      <description>removefilters( T[Col] ) = all( T[Col] )</description>
      <pubDate>Mon, 19 Oct 2020 21:05:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1443061#M27017</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-19T21:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: ALLEXCEPT behaviour in one to many relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1443066#M27018</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="208948" data-lia-user-login="ivanmezev" class="lia-mention lia-mention-user"&gt;ivanmezev&lt;/a&gt;&amp;nbsp; - I admittedly don't know anything about Analysis Services, but can this work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;PlayersAllGames =
CALCULATE (
    DISTINCTCOUNT ( Player[PlayerID] ),
    ALL ( Player[Category] ),
    ALL ( Game ),
    KEEPFILTERS ( Game[GameID] )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 21:12:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1443066#M27018</guid>
      <dc:creator>dedelman_clng</dc:creator>
      <dc:date>2020-10-19T21:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: ALLEXCEPT behaviour in one to many relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1444597#M27054</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="208948" data-lia-user-login="ivanmezev" class="lia-mention lia-mention-user"&gt;ivanmezev&lt;/a&gt;&amp;nbsp; Hey Mate ,&lt;BR /&gt;you can use Below formula.&lt;BR /&gt;Measure = calculate(countrows(table)).&lt;BR /&gt;this will automaticly do the context transition .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do you remove all other fiter and keep only selected filter ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Allexcept" href="https://docs.microsoft.com/en-us/dax/allexcept-function-dax" target="_self"&gt;https://docs.microsoft.com/en-us/dax/allexcept-function-dax&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 10:48:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1444597#M27054</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-20T10:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: ALLEXCEPT behaviour in one to many relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1444784#M27060</link>
      <description>&lt;P&gt;REMOVEFILTERS in PBI is totally equivalent to ALL, so use this:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;calculate(
    distinctcount( TableA[PlayerID] ),
    all( TableA[Category] )
)&lt;/LI-CODE&gt;&lt;P&gt;This formula just calculates the count of distinct PlayerID's after taking off all the filters from Category. Is this not what you wanted?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 11:56:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1444784#M27060</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-20T11:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: ALLEXCEPT behaviour in one to many relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1445004#M27068</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found where my mistake is. I have Category sorted by Category_Id and turned out that ALL and ALLEXCEPT doesn't work as expected in this case. In order to make it working both Category and Category_Id should be included in ALL clause.&lt;/P&gt;&lt;P&gt;The correct formula for me is:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;calculate(
    distinctcount( TableA[player_id] ),
    ALL(TableA[Category_ID]),
    ALL(TableA[Category])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;There is a very interesting article about this here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/side-effects-in-dax-of-the-sort-by-column-setting/" target="_blank" rel="noopener"&gt;https://www.sqlbi.com/articles/side-effects-in-dax-of-the-sort-by-column-setting/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 13:49:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1445004#M27068</guid>
      <dc:creator>ivanmezev</dc:creator>
      <dc:date>2020-10-20T13:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: ALLEXCEPT behaviour in one to many relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1445045#M27070</link>
      <description>You don't have to split the conditions into 2. You can use both columns in one ALL: ALL( T[Col1], T[Col2] )</description>
      <pubDate>Tue, 20 Oct 2020 14:06:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALLEXCEPT-behaviour-in-one-to-many-relationship/m-p/1445045#M27070</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-20T14:06:20Z</dc:date>
    </item>
  </channel>
</rss>

