<?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: Tretas : Not getting count based on variable in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2284930#M56005</link>
    <description>&lt;P&gt;Great!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please accept the solution(s) that resolved your question in order to mark it as accepted so future readers can find it more quickly.&lt;/P&gt;</description>
    <pubDate>Sat, 15 Jan 2022 16:31:00 GMT</pubDate>
    <dc:creator>AlexisOlson</dc:creator>
    <dc:date>2022-01-15T16:31:00Z</dc:date>
    <item>
      <title>Tretas : Not getting count based on variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2283542#M55919</link>
      <description>&lt;P&gt;Hello Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;am trying to get count of priority am using below code but it is not working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Inflow_Priority = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;CompanyRegionAU_Company&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Max&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;CompanyRegionAU[Company]&lt;/SPAN&gt;&lt;SPAN&gt;)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t;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TREATAS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table_join&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Source[company]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Source[Region]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Source[Queue]&lt;/SPAN&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;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Chandrashekar B&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Jan 2022 10:23:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2283542#M55919</guid>
      <dc:creator>Chandrashekar</dc:creator>
      <dc:date>2022-01-14T10:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Tretas : Not getting count based on variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2283572#M55922</link>
      <description>&lt;P&gt;Hello Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see attached example report&amp;nbsp;&lt;A title="Sample Report" href="https://drive.google.com/file/d/1VBSivz-ARzFJBB2YxWA0gUcA4M791j_d/view?usp=sharing" target="_self"&gt;Sample Report as&amp;nbsp;&lt;/A&gt;&lt;SPAN&gt;am trying to get priority count am using below code but it is not working.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 10:49:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2283572#M55922</guid>
      <dc:creator>Chandrashekar</dc:creator>
      <dc:date>2022-01-14T10:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Tretas : Not getting count based on variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2283746#M55936</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Is this your desired result?&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 13:02:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2283746#M55936</guid>
      <dc:creator>DimaMD</dc:creator>
      <dc:date>2022-01-14T13:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Tretas : Not getting count based on variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2283871#M55943</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="349843" data-lia-user-login="Chandrashekar" class="lia-mention lia-mention-user"&gt;Chandrashekar&lt;/a&gt;&amp;nbsp; I am guessing you are expecting this&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;To reach the following outcome, you need two measures&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;_countrows =
VAR _name =
    MAX ( Table3[Name] )
VAR _location =
    MAX ( Table3[Location] )
VAR _tbl =
    CROSSJOIN (
        SELECTCOLUMNS ( { _name }, "name", [Value] ),
        SELECTCOLUMNS ( { _location }, "location", [Value] )
    )
RETURN
    CALCULATE (
        COUNTROWS ( FILTER ( Table1, Table1[Priority] = 1 ) ),
        TREATAS ( _tbl, Table1[Name], Table1[Location] )
    )



Sum = SUMX(Table3,[_countrows])&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;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 14:27:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2283871#M55943</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2022-01-14T14:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Tretas : Not getting count based on variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2284083#M55957</link>
      <description>&lt;P&gt;The cross join construction feels odd to me.&lt;/P&gt;
&lt;P&gt;I think I'd try writing this DAX more like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;Inflow_Priority =
CALCULATE (
    COUNTROWS ( Source ),
    FILTER ( ALL ( Source ), Source[Priority_is] = 1 ),
    TREATAS (
        SUMMARIZE ( CompanyRegionAU, CompanyRegionAU[Company], CompanyRegionAU[Region] ),
        Source[company], Source[Region]
    ),
    TREATAS ( VALUES ( Queue[Queue] ), Source[Queue] )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 16:02:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2284083#M55957</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-01-14T16:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Tretas : Not getting count based on variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2284750#M55992</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to Priority1 and Pririty 2 in two different columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chandrashekar B&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jan 2022 09:08:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2284750#M55992</guid>
      <dc:creator>Chandrashekar</dc:creator>
      <dc:date>2022-01-15T09:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Tretas : Not getting count based on variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2284758#M55994</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to Priority1 and Pririty 2 in two different columns.&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;Regards,&lt;/P&gt;&lt;P&gt;Chandrashekar B&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jan 2022 09:16:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2284758#M55994</guid>
      <dc:creator>Chandrashekar</dc:creator>
      <dc:date>2022-01-15T09:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Tretas : Not getting count based on variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2284761#M55995</link>
      <description>&lt;P&gt;Hello Alex,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your solution but it is not working. I need Priority 1 and Priority 2 in different columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chandrashekar B&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jan 2022 09:25:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2284761#M55995</guid>
      <dc:creator>Chandrashekar</dc:creator>
      <dc:date>2022-01-15T09:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Tretas : Not getting count based on variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2284789#M55997</link>
      <description>&lt;P&gt;Hello Alex,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry it is my mistake(Format issue it was text and turned to Number) and it is working now.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jan 2022 10:51:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2284789#M55997</guid>
      <dc:creator>Chandrashekar</dc:creator>
      <dc:date>2022-01-15T10:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Tretas : Not getting count based on variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2284930#M56005</link>
      <description>&lt;P&gt;Great!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please accept the solution(s) that resolved your question in order to mark it as accepted so future readers can find it more quickly.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jan 2022 16:31:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tretas-Not-getting-count-based-on-variable/m-p/2284930#M56005</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-01-15T16:31:00Z</dc:date>
    </item>
  </channel>
</rss>

