<?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: summary stats in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/summary-stats/m-p/2489788#M35870</link>
    <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can create a Type table first then create a measure to count the number of customer in each type.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Type = 
DATATABLE(
"Type", STRING,{
{"New"},
{"Increase +200%"},
{"Increase 150 - 199%"},
{"Increase 0 - 149%"},
{"Decrease"},
{"Lost"}
}
)&lt;/LI-CODE&gt;
&lt;P&gt;Measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
VAR _ADD = 
ADDCOLUMNS('Type',"COUNT",
SWITCH('Type'[Type],
"New",CALCULATE(COUNT('Table'[customer name]),'Table'[Increase/Decrease $] = "New"),
"Lost",CALCULATE(COUNT('Table'[customer name]),'Table'[Increase/Decrease $] = "Lost"),
"Decrease",CALCULATE(COUNT('Table'[customer name]),'Table'[Increase/Decrease %] &amp;lt; 0),
"Increase 0 - 149%",CALCULATE(COUNT('Table'[customer name]),FILTER('Table','Table'[Increase/Decrease %]&amp;lt;&amp;gt;BLANK()&amp;amp;&amp;amp;'Table'[Increase/Decrease %] &amp;gt;= 0&amp;amp;&amp;amp;'Table'[Increase/Decrease %]&amp;lt;=1.49)),
"Increase 150 - 199%",CALCULATE(COUNT('Table'[customer name]),FILTER('Table','Table'[Increase/Decrease %] &amp;gt;= 1.5&amp;amp;&amp;amp;'Table'[Increase/Decrease %]&amp;lt;=1.99)),
CALCULATE(COUNT('Table'[customer name]),FILTER('Table','Table'[Increase/Decrease %] &amp;gt;= 2))
)
)
RETURN
SUMX(_ADD,[COUNT])&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RicoZhou_0-1651543380546.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/708203iEFBE4C2E61EE9667/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RicoZhou_0-1651543380546.png" alt="RicoZhou_0-1651543380546.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Tue, 03 May 2022 02:03:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-05-03T02:03:33Z</dc:date>
    <item>
      <title>summary stats</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/summary-stats/m-p/2486105#M35806</link>
      <description>&lt;P&gt;I have database of customers and their sales history.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am comparing the current year sales to the previous year sales&lt;/P&gt;&lt;P&gt;the data would look like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;customer name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2020 sales $&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021 sales $&amp;nbsp; &amp;nbsp; &amp;nbsp;Increase/Decrease $&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Increase/Decrease %&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;joe&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;200&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100&lt;/P&gt;&lt;P&gt;bob&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;150&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;New&lt;/P&gt;&lt;P&gt;Sally&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;250&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 150&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-40%&lt;/P&gt;&lt;P&gt;Carol&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;450&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Lost&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can do the above fine in powerbi desktop, but what I cannot do is create a summary table like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Type&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# of Customers&lt;/P&gt;&lt;P&gt;New&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;45&lt;/P&gt;&lt;P&gt;Increase +200%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7&lt;/P&gt;&lt;P&gt;Increase 150 - 199%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12&lt;/P&gt;&lt;P&gt;Increase 0 - 149%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;14&amp;nbsp;&lt;/P&gt;&lt;P&gt;Decrease&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;32&lt;/P&gt;&lt;P&gt;Lost&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;45&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 15:49:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/summary-stats/m-p/2486105#M35806</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-29T15:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: summary stats</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/summary-stats/m-p/2489788#M35870</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can create a Type table first then create a measure to count the number of customer in each type.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Type = 
DATATABLE(
"Type", STRING,{
{"New"},
{"Increase +200%"},
{"Increase 150 - 199%"},
{"Increase 0 - 149%"},
{"Decrease"},
{"Lost"}
}
)&lt;/LI-CODE&gt;
&lt;P&gt;Measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
VAR _ADD = 
ADDCOLUMNS('Type',"COUNT",
SWITCH('Type'[Type],
"New",CALCULATE(COUNT('Table'[customer name]),'Table'[Increase/Decrease $] = "New"),
"Lost",CALCULATE(COUNT('Table'[customer name]),'Table'[Increase/Decrease $] = "Lost"),
"Decrease",CALCULATE(COUNT('Table'[customer name]),'Table'[Increase/Decrease %] &amp;lt; 0),
"Increase 0 - 149%",CALCULATE(COUNT('Table'[customer name]),FILTER('Table','Table'[Increase/Decrease %]&amp;lt;&amp;gt;BLANK()&amp;amp;&amp;amp;'Table'[Increase/Decrease %] &amp;gt;= 0&amp;amp;&amp;amp;'Table'[Increase/Decrease %]&amp;lt;=1.49)),
"Increase 150 - 199%",CALCULATE(COUNT('Table'[customer name]),FILTER('Table','Table'[Increase/Decrease %] &amp;gt;= 1.5&amp;amp;&amp;amp;'Table'[Increase/Decrease %]&amp;lt;=1.99)),
CALCULATE(COUNT('Table'[customer name]),FILTER('Table','Table'[Increase/Decrease %] &amp;gt;= 2))
)
)
RETURN
SUMX(_ADD,[COUNT])&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RicoZhou_0-1651543380546.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/708203iEFBE4C2E61EE9667/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RicoZhou_0-1651543380546.png" alt="RicoZhou_0-1651543380546.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 02:03:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/summary-stats/m-p/2489788#M35870</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-03T02:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: summary stats</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/summary-stats/m-p/2496277#M35926</link>
      <description>&lt;P&gt;thanks for this code, it looks logical.&amp;nbsp; I was able to update my dashboard to include the table and field name in my system and the 2 column Type and the measure Customer_Stats both save without error.&amp;nbsp; but when I go to use the customer_stats measure and/or the type field I get the error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;query(2,1) a table of multiple values was supplied where a single value was expected.&lt;/P&gt;&lt;P&gt;thoughts&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 14:09:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/summary-stats/m-p/2496277#M35926</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-05T14:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: summary stats</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/summary-stats/m-p/2497707#M35939</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There may be some problem in your code, this error will appear when your code will return multiple values like lists/table but Power BI only support single value.&lt;/P&gt;
&lt;P&gt;We can see that my measure above will all return single aggregate values.&lt;/P&gt;
&lt;P&gt;If this still couldn't help you solve your problem please&amp;nbsp;share a sample file with me and show me a screenshot with the result you want. This will make it easier for me to find the solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 06:21:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/summary-stats/m-p/2497707#M35939</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-06T06:21:19Z</dc:date>
    </item>
  </channel>
</rss>

