<?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: Multiple CountIf function in Power Query in Power Query</title>
    <link>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1327544#M42011</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="52518" data-lia-user-login="Fowmy" class="lia-mention lia-mention-user"&gt;Fowmy&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks a lot! It works!&lt;/P&gt;</description>
    <pubDate>Thu, 27 Aug 2020 03:18:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-08-27T03:18:28Z</dc:date>
    <item>
      <title>Multiple CountIf function in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1321475#M41794</link>
      <description>&lt;P&gt;Hello everyone,&lt;BR /&gt;&lt;BR /&gt;I would like to enforce a countif function in from a data source I have.&lt;BR /&gt;&lt;BR /&gt;There are multiple columns containing a "Yes", "No" data. Is there a way I can enforce a countif function using Power Query?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 05:56:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1321475#M41794</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-25T05:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple CountIf function in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1321517#M41799</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can you share some sample data and the expected result to have a clear understanding of your question?&lt;BR /&gt;You can save your files in OneDrive, Google Drive, or any other cloud sharing platforms and share the link here.&lt;BR /&gt;____________________________________&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;How to paste sample data with your question?&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to get your questions answered quickly?&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;_____________________________________&lt;BR /&gt;Did I answer your question? Mark this post as a solution, this will help others!.&lt;/P&gt;&lt;P&gt;Click on the Thumbs-Up icon if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank"&gt;YouTube, &lt;/A&gt;&lt;A href="https://linkedin.com/in/fowmy" target="_blank"&gt;LinkedIn&lt;/A&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 06:16:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1321517#M41799</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-08-25T06:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple CountIf function in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1321567#M41802</link>
      <description>&lt;P&gt;Hello Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can make a countif with Table.RowsCount and Table.SelectRows. Basically first filter the table and then count the rows.&lt;/P&gt;
&lt;P&gt;this code would look like this&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;CountIf = Table.RowCount(Table.SelectRows(PreviousStep, each [A]="yes" and [B]="yes" and [C]="no"))
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here the complete example&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WqkwtVtKBknn5SrE60QgOXATGRlOCIOGKUIXQDY8FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [A = _t, B = _t, C = _t]),
    PreviousStep = Table.TransformColumnTypes(Source,{{"A", type text}, {"B", type text}, {"C", type text}}), 
    CountIf = Table.RowCount(Table.SelectRows(PreviousStep, each [A]="yes" and [B]="yes" and [C]="no"))
in
    CountIf&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Copy paste this code to the advanced editor in a new blank query to see how the solution works.&lt;BR /&gt;&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt; or &lt;STRONG&gt;solves &lt;/STRONG&gt;your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)&lt;BR /&gt;Kudoes are nice too&lt;BR /&gt;&lt;BR /&gt;Have fun&lt;BR /&gt;&lt;BR /&gt;Jimmy&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 06:39:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1321567#M41802</guid>
      <dc:creator>Jimmy801</dc:creator>
      <dc:date>2020-08-25T06:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple CountIf function in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1321660#M41804</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="52518" data-lia-user-login="Fowmy" class="lia-mention lia-mention-user"&gt;Fowmy&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Since the data is confidential, I have sent a modified excel file for you to have a look at it. FYI, data that I'm using comes from a Sharepoint list connected to Excel.&lt;BR /&gt;&lt;BR /&gt;What I would like to achieve is a COUNTIF Function on columns. If any of these columns contains a "No", then it should count as 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;I don't think conditional formatting column works because it doesn't seem to count the next column after that. I have thought of using excel formula but it would be easier if I can achieve this in Power Query itself.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 07:16:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1321660#M41804</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-25T07:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple CountIf function in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1321723#M41805</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Try this in a blank query and you can copy the following code in blank query and check the steps.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnEMcVTSwUbF6sBl/fxhBLoMsgKIXCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t]),
    #"Added Custom" = Table.AddColumn(Source, "New Col", each List.Count(List.Select(Record.ToList(_), each _ =  "NO")))
in
    #"Added Custom"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;________________________&lt;/P&gt;&lt;P&gt;If my answer was helpful, please mark this post as a solution, this will also help others!.&lt;/P&gt;&lt;P&gt;Click on the &lt;STRONG&gt;Thumbs-Up icon &lt;/STRONG&gt;if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="blue"&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank" rel="noopener"&gt;YouTube&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://linkedin.com/in/fowmy" target="_blank" rel="noopener"&gt;LinkedIn&lt;/A&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 12:13:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1321723#M41805</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-08-25T12:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple CountIf function in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1321963#M41809</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can add this formula to a new column&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;if List.AnyTrue(List.Transform(Record.ToList(_), each _ = "no"))=true then 1 else 0&lt;/LI-CODE&gt;
&lt;P&gt;this gives you 1 if a "no" is present in your row&lt;/P&gt;
&lt;P&gt;here the complete code&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WqkwtVtKBknn5SrE60QgOXATGRlOCIOGKUIXQDY8FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [A = _t, B = _t, C = _t]),
    PreviousStep = Table.TransformColumnTypes(Source,{{"A", type text}, {"B", type text}, {"C", type text}}),
    AddCountIf = Table.AddColumn
    (
        PreviousStep,
        "CountIfNo",
        each if List.AnyTrue(List.Transform(Record.ToList(_), each _ = "no"))=true then 1 else 0
    )
in
    AddCountIf&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Copy paste this code to the advanced editor in a new blank query to see how the solution works.&lt;BR /&gt;&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt; or &lt;STRONG&gt;solves &lt;/STRONG&gt;your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)&lt;BR /&gt;Kudoes are nice too&lt;BR /&gt;&lt;BR /&gt;Have fun&lt;BR /&gt;&lt;BR /&gt;Jimmy&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 08:30:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1321963#M41809</guid>
      <dc:creator>Jimmy801</dc:creator>
      <dc:date>2020-08-25T08:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple CountIf function in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1324203#M41891</link>
      <description>&lt;P&gt;Hi there&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="52518" data-lia-user-login="Fowmy" class="lia-mention lia-mention-user"&gt;Fowmy&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Your code works! Thanks a lot!&lt;BR /&gt;&lt;BR /&gt;However, I would like to see if I'm able to group the columns. Example, Column 1, Column 2 and Column 3 into a new COUNTIF Column. Then Column 4, Column 5 and Column 6 into another new COUNTIF Column.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;With you current code, do I need to separate each columns into separate subset code?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 01:14:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1324203#M41891</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-26T01:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple CountIf function in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1324687#M41905</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please try the following code, I have added two columns as requested:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnEMcVTSwUbF6sBl/fxhBLoMsgKIXCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t]),
    #"Added Custom" = Table.AddColumn(Source, "1st Two Columns", each List.Count(List.Select(Record.ToList(Record.SelectFields(_,{"Column1","Column2"})), each _ =  "NO"))),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "2nd Two Columns", each List.Count(List.Select(Record.ToList(Record.SelectFields(_,{"Column3","Column4"})), each _ =  "NO")))
in
    #"Added Custom1"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;________________________&lt;/P&gt;&lt;P&gt;If my answer was helpful, please mark it as a solution&lt;/P&gt;&lt;P&gt;Click on the &lt;STRONG&gt;Thumbs-Up icon &lt;/STRONG&gt;if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank"&gt;&lt;FONT color="blue"&gt;YouTube&lt;/FONT&gt;&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://linkedin.com/in/fowmy" target="_blank"&gt;&lt;FONT color="blue"&gt;LinkedIn&lt;/FONT&gt;&lt;/A&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 05:49:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1324687#M41905</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-08-26T05:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple CountIf function in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1327544#M42011</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="52518" data-lia-user-login="Fowmy" class="lia-mention lia-mention-user"&gt;Fowmy&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks a lot! It works!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 03:18:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Multiple-CountIf-function-in-Power-Query/m-p/1327544#M42011</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-27T03:18:28Z</dc:date>
    </item>
  </channel>
</rss>

