<?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: DAX Summarizecolumns and then countrows per group in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Summarizecolumns-and-then-countrows-per-group/m-p/3643126#M141058</link>
    <description>&lt;P&gt;Thank you for your answer!&lt;BR /&gt;&lt;BR /&gt;I've tried your query but it gives me an error&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jan 2024 09:21:34 GMT</pubDate>
    <dc:creator>Mikeysw</dc:creator>
    <dc:date>2024-01-17T09:21:34Z</dc:date>
    <item>
      <title>DAX Summarizecolumns and then countrows per group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Summarizecolumns-and-then-countrows-per-group/m-p/3641240#M140968</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have query with 3 dimensions (Continent/CountryRegion/City) part of paginated report.&lt;/P&gt;&lt;P&gt;I would like to highlight only those child groups where there is 1 item.&lt;/P&gt;&lt;P&gt;So I need to get a count of items per each parent group.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case, let's write the query, to be more exact.&lt;/P&gt;&lt;P&gt;EVALUATE&lt;BR /&gt;VAR __t1 =&lt;BR /&gt;SUMMARIZECOLUMNS (&lt;BR /&gt;Customer[Continent],&lt;BR /&gt;Customer[CountryRegion],&lt;BR /&gt;Customer[City],&lt;BR /&gt;"Amount", [Sales Amount]&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;RETURN&lt;BR /&gt;GROUPBY(&lt;BR /&gt;__t1,&lt;BR /&gt;Customer[Continent],&lt;BR /&gt;Customer[CountryRegion],&lt;BR /&gt;"Count" , countX(CURRENTGROUP(), Customer[CountryRegion] )&lt;BR /&gt;) ORDER BY Customer[Continent] DESC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which brings me this&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result I am looking for is&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And in a case where I have 3 dimensions&lt;BR /&gt;EVALUATE&lt;BR /&gt;VAR __t1 =&lt;BR /&gt;SUMMARIZECOLUMNS (&lt;BR /&gt;Customer[Continent],&lt;BR /&gt;Customer[CountryRegion],&lt;BR /&gt;Customer[City],&lt;BR /&gt;"Amount", [Sales Amount]&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;RETURN&lt;BR /&gt;GROUPBY(&lt;BR /&gt;__t1,&lt;BR /&gt;Customer[Continent],&lt;BR /&gt;Customer[CountryRegion],&lt;BR /&gt;Customer[City],&lt;BR /&gt;"Count" , countX(CURRENTGROUP(), Customer[City] )&lt;BR /&gt;) ORDER BY Customer[Continent] DESC&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I get&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I would like to see&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;&lt;P&gt;How should I approach this?&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 14:43:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Summarizecolumns-and-then-countrows-per-group/m-p/3641240#M140968</guid>
      <dc:creator>mikeys</dc:creator>
      <dc:date>2024-01-16T14:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Summarizecolumns and then countrows per group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Summarizecolumns-and-then-countrows-per-group/m-p/3642981#M141046</link>
      <description>&lt;P&gt;&lt;SPAN&gt;To achieve the desired result, you can use the following approach:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EVALUATE&lt;BR /&gt;VAR __t1 =&lt;BR /&gt;SUMMARIZECOLUMNS (&lt;BR /&gt;Customer[Continent],&lt;BR /&gt;Customer[CountryRegion],&lt;BR /&gt;Customer[City],&lt;BR /&gt;"Amount", [Sales Amount]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;VAR __t2 =&lt;BR /&gt;SUMMARIZECOLUMNS (&lt;BR /&gt;__t1,&lt;BR /&gt;Customer[Continent],&lt;BR /&gt;Customer[CountryRegion],&lt;BR /&gt;"Count", COUNTROWS(__t1)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;RETURN&lt;BR /&gt;GROUPBY(&lt;BR /&gt;__t2,&lt;BR /&gt;Customer[Continent],&lt;BR /&gt;Customer[CountryRegion],&lt;BR /&gt;"Count", COUNTROWS(CURRENTGROUP())&lt;BR /&gt;) ORDER BY Customer[Continent] DESC, Customer[CountryRegion] DESC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this query:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The first SUMMARIZECOLUMNS creates a table (__t1) with the necessary dimensions and the "Amount" measure.&lt;/LI&gt;&lt;LI&gt;The second SUMMARIZECOLUMNS adds another level of summarization (__t2) based on the first table (__t1), and calculates the count of rows for each combination of Continent and CountryRegion.&lt;/LI&gt;&lt;LI&gt;The final GROUPBY groups the second table (__t2) by Continent and CountryRegion and calculates the count of rows for each group.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This should give you the desired result, showing the count of items per each parent group, and only highlighting those groups where there is 1 item.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 08:18:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Summarizecolumns-and-then-countrows-per-group/m-p/3642981#M141046</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-01-17T08:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Summarizecolumns and then countrows per group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Summarizecolumns-and-then-countrows-per-group/m-p/3643126#M141058</link>
      <description>&lt;P&gt;Thank you for your answer!&lt;BR /&gt;&lt;BR /&gt;I've tried your query but it gives me an error&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 09:21:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Summarizecolumns-and-then-countrows-per-group/m-p/3643126#M141058</guid>
      <dc:creator>Mikeysw</dc:creator>
      <dc:date>2024-01-17T09:21:34Z</dc:date>
    </item>
  </channel>
</rss>

