<?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: How to flag the maximum occurences by a category in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2523968#M70503</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I meant like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Maximum_category =
CALCULATE (
    MAXX ( VALUES ( senso[characteristic] ), [Nb_frm_avant] ),
    ALLEXCEPT ( senso, senso[characteristic], senso[category] )
)&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 18 May 2022 16:48:51 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-05-18T16:48:51Z</dc:date>
    <item>
      <title>How to flag the maximum occurences by a category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2520621#M70248</link>
      <description>&lt;P&gt;Hello, I have a problem with measures in DAX, I hope you can help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to flag the cod_formula for which the characteristic doesn't occur most.&lt;/P&gt;&lt;P&gt;My dataset is like this :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I would like to have a 4th column with value "YES" if the characteristic is the most represented for each category and "NO" otherwise. In this example, it means there is only one value "NO" for the line&lt;/P&gt;&lt;P&gt;cod_formula 2021502 3 ; category CONSISTENCY ; characteristic 3/5 MEDIUM LOW&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to first calculate the number of occurence of each characteristic with the measure&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Nb_frm_avant = CALCULATE(COUNT(senso[characteristic]),(FILTER(senso, ([InSocle] = "OUT" || [InSocle] = "NO CHANGE"))))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;which is working correctly and returns&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I calculate the maximum occurence for each characteristic with the measure :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Maximum_category = MAXX (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATETABLE (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VALUES ( 'senso'[characteristic] ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALLSELECTED ( senso[characteristic])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[Nb_frm_avant]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Which is also working correctly :&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And finally I created the measure flg_max :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;flg_max = IF([Nb_frm_avant]=[Maximum_category],"Yes","No")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Which results in :&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;Which is cool!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I don't know how to have these same results adding the cod_formula beacause I have this table. I want the number above repeated for each duo category/characteristic and it's not the case as I only have 1 as a value.&lt;/P&gt;&lt;img /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I don't know if I'm clear enough. Suggestions would be greatly appreciated.&lt;/DIV&gt;&lt;DIV&gt;Best regards,&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Quentin.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 17 May 2022 13:15:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2520621#M70248</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-17T13:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to flag the maximum occurences by a category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2520738#M70261</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Beautiful code. Good job.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Maximum_category =
MAXX (
    CALCULATETABLE (
        VALUES ( 'senso'[characteristic] ),
        ALLSELECTED ( senso[characteristic] ),
        REMOVEFILTERS ( senso[code_formula] )
    ),
    [Nb_frm_avant]
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 17 May 2022 13:50:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2520738#M70261</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-17T13:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to flag the maximum occurences by a category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2521039#M70286</link>
      <description>&lt;P&gt;Hi! Thank you!&lt;/P&gt;&lt;P&gt;Unfortunately it doesn't solve my problem, I still have the same results in the last table I posted.&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 15:21:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2521039#M70286</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-17T15:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to flag the maximum occurences by a category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2521098#M70295</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok. Please try&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Maximum_category =
MAXX (
    VALUES ( senso[characteristic] ),
    CALCULATE (
        [Nb_frm_avant],
        ALLEXCEPT ( senso, senso[characteristic], senso[category] )
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 17 May 2022 15:47:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2521098#M70295</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-17T15:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to flag the maximum occurences by a category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2521155#M70304</link>
      <description>&lt;P&gt;Now I have this :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In the column "Maximum_category" I now have the results I would like to have in "Nb_frm_avant"&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moreover I think I need to do a modification in the measure Nb_frm_avant also but I don't see which one ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 16:10:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2521155#M70304</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-17T16:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to flag the maximum occurences by a category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2521211#M70308</link>
      <description>&lt;P&gt;Create new measure&lt;/P&gt;&lt;PRE&gt;    CALCULATE (
        [Nb_frm_avant],
        ALLEXCEPT ( senso, senso[characteristic], senso[category] )
    )&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 May 2022 16:27:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2521211#M70308</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-17T16:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to flag the maximum occurences by a category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2523540#M70474</link>
      <description>&lt;P&gt;Hello&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;/P&gt;&lt;P&gt;Thank you for your help. I think I'm not far from the solution.&lt;/P&gt;&lt;P&gt;My last concern is about the Maximum_category measure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't suceed to calculate the maximum of the measure you just told me in the last message (I called this measure Nb_occurence) by category&lt;/P&gt;&lt;P&gt;My measure is this one :&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Maximum_category = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MAXX (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VALUES (senso[characteristic]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[Nb_occurence],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALLEXCEPT (senso, senso[characteristic], senso[category])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;But it returns the same results as the measure as you can see :&amp;nbsp;&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;Any idea ?&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 13:57:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2523540#M70474</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-18T13:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to flag the maximum occurences by a category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2523968#M70503</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I meant like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Maximum_category =
CALCULATE (
    MAXX ( VALUES ( senso[characteristic] ), [Nb_frm_avant] ),
    ALLEXCEPT ( senso, senso[characteristic], senso[category] )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 18 May 2022 16:48:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-flag-the-maximum-occurences-by-a-category/m-p/2523968#M70503</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-18T16:48:51Z</dc:date>
    </item>
  </channel>
</rss>

