<?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: Count Strings and return top 1  from a measure with Switch() in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Strings-and-return-top-1-from-a-measure-with-Switch/m-p/2871911#M92721</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , If winner is a measure, first you have to do dynamic segmentation and then try for TOPN of rank &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: &lt;A href="https://www.youtube.com/watch?v=W4EF1f_k6iY" target="_blank"&gt;https://www.youtube.com/watch?v=W4EF1f_k6iY&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 29 Oct 2022 03:27:36 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-10-29T03:27:36Z</dc:date>
    <item>
      <title>Count Strings and return top 1  from a measure with Switch()</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Strings-and-return-top-1-from-a-measure-with-Switch/m-p/2870878#M92628</link>
      <description>&lt;P&gt;Hi all&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem with calculating max occurence of a string from measure Winner&lt;/P&gt;&lt;P&gt;there are 3 option : CONS STAT and EQUAL, based on Delta measure&lt;/P&gt;&lt;P&gt;Is it possible to return a winer over entire period ? (top 1 of occurences from Winner measure)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 13:05:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Strings-and-return-top-1-from-a-measure-with-Switch/m-p/2870878#M92628</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-28T13:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Count Strings and return top 1  from a measure with Switch()</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Strings-and-return-top-1-from-a-measure-with-Switch/m-p/2871911#M92721</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , If winner is a measure, first you have to do dynamic segmentation and then try for TOPN of rank &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: &lt;A href="https://www.youtube.com/watch?v=W4EF1f_k6iY" target="_blank"&gt;https://www.youtube.com/watch?v=W4EF1f_k6iY&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Oct 2022 03:27:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Strings-and-return-top-1-from-a-measure-with-Switch/m-p/2871911#M92721</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-10-29T03:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Count Strings and return top 1  from a measure with Switch()</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Strings-and-return-top-1-from-a-measure-with-Switch/m-p/2874151#M92838</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your description, I have created a simple sample:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
VAR _a =
    ADDCOLUMNS ( 'Cal Year', "Winner", [Winner] )
VAR _b =
    ADDCOLUMNS (
        { "CONS", "EQUAL", "STAT" },
        "Count", COUNTX ( FILTER ( _a, [Winner] = EARLIER ( [Value] ) ), [Winner] )
    )
VAR _c =
    MAXX ( _b, [Count] )
VAR _d =
    MAXX ( FILTER ( _b, [Count] = _c ), [Value] )
RETURN
    "Winner: " &amp;amp; _d &amp;amp; "  Count: " &amp;amp; _c&lt;/LI-CODE&gt;
&lt;P&gt;Final output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jianbo Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 08:19:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Strings-and-return-top-1-from-a-measure-with-Switch/m-p/2874151#M92838</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2022-10-31T08:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Count Strings and return top 1  from a measure with Switch()</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Strings-and-return-top-1-from-a-measure-with-Switch/m-p/2879471#M93136</link>
      <description>&lt;P&gt;Thank you!! works perfectly:)&lt;/P&gt;&lt;P&gt;would it be possible to pass dynamic table into _b variable? instead of {"CONS","STAT","EQUAL"} having a distinct values from "Winner" column from _a variable?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 08:49:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Strings-and-return-top-1-from-a-measure-with-Switch/m-p/2879471#M93136</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-02T08:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Count Strings and return top 1  from a measure with Switch()</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Strings-and-return-top-1-from-a-measure-with-Switch/m-p/2879483#M93137</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you can use SUMMARIZE() function,&amp;nbsp;&lt;SPAN&gt;it returns a summary table for the requested totals over a set of groups.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For more details, please refer to:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/summarize-function-dax" target="_blank"&gt;SUMMARIZE function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="background: white; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;Jianbo Li&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 08:53:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Strings-and-return-top-1-from-a-measure-with-Switch/m-p/2879483#M93137</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2022-11-02T08:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Count Strings and return top 1  from a measure with Switch()</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Strings-and-return-top-1-from-a-measure-with-Switch/m-p/2946781#M97539</link>
      <description>&lt;P&gt;Hi, thanks for reply,&lt;/P&gt;&lt;P&gt;I had made dynamic segmentation and it works but only if i sum winner over a calendar,&lt;/P&gt;&lt;P&gt;when i want to count winner over a product it seems im missing a relation in a measure&lt;/P&gt;&lt;P&gt;My current segment:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Measure&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;and the output&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;now i need to make matrix table with my products in rows and Scenario (cons, stat,equal) as columns&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;this seems like im missing the relation between my measure and the material table. I've tried to change a measure by replacing countrows(cal year) with countrows(fact_table - which has material column) but the query is too big to calculate. Same issue when i use virtual table...is there a simple way to calculate the segment over date by each material?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 07:23:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Strings-and-return-top-1-from-a-measure-with-Switch/m-p/2946781#M97539</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-05T07:23:11Z</dc:date>
    </item>
  </channel>
</rss>

