<?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 with Text and multiple OR statements in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-with-Text-and-multiple-OR-statements/m-p/3216747#M117452</link>
    <description>&lt;P&gt;The syntax is a little off.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DIVIDE(COUNTA(Column1) , IF ( [column1]="1"  || [column2] ="1"  || [column3] ="1"  || [column4] ="1"  || [column5] ="1",count(respondents)),0)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 May 2023 23:37:51 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2023-05-02T23:37:51Z</dc:date>
    <item>
      <title>COUNT with Text and multiple OR statements</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-with-Text-and-multiple-OR-statements/m-p/3214345#M117331</link>
      <description>&lt;P&gt;Hi All! I am struggling a little with an equation. Overall I am trying to divide count(column1)/count(respondents) in simple terms but it is turning out to be a little harder than that which is where I would appriciate your help. (Also this is my first time posting so if I am missing any info just let me know and I will provide!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the behind the scenes of the data is that there is a question being asked and each column is one of the answers to the select all questions. So for example:&lt;/P&gt;&lt;P&gt;What did you enjoy about your stay?&lt;/P&gt;&lt;P&gt;Column 1: The Pool&lt;/P&gt;&lt;P&gt;Column 2: The Food&lt;/P&gt;&lt;P&gt;Column 3: The Staff&lt;/P&gt;&lt;P&gt;Column 4: The Golf Course&lt;/P&gt;&lt;P&gt;Column 5: Nothing&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So one reason why we cant just divide by the number of respondents is because there may be a respondent who never got that question and so they shouldn't count in denominator since they never had it. We just want the % of people who selected each option from this survey.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So here is some sample data:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;respondent&lt;/TD&gt;&lt;TD&gt;column1&lt;/TD&gt;&lt;TD&gt;column2&lt;/TD&gt;&lt;TD&gt;column3&lt;/TD&gt;&lt;TD&gt;column4&lt;/TD&gt;&lt;TD&gt;column5&lt;/TD&gt;&lt;TD&gt;question2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;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&gt;&lt;P&gt;* data is in string(text) format not number format&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So what I am currently thinking is&amp;nbsp;&lt;/P&gt;&lt;P&gt;COUNTA(Column1*) / IF (column1) ="1"&amp;nbsp; OR&amp;nbsp;(column2) ="1"&amp;nbsp; OR&amp;nbsp;(column3) ="1"&amp;nbsp; OR&amp;nbsp;(column4) ="1"&amp;nbsp; OR&amp;nbsp;(column5) ="1"&amp;nbsp; THEN count(respondents)&lt;/P&gt;&lt;P&gt;* i would replace this with each column and then put into y-axis field because i want a legend for each of them&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this doesn't work because one, if statement doesn't work with text, and two, i can't do an or statement with more than 2 statements/expressions but that equation is just how my mind is thinking.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another thing to note is I cant do the sum of the count of each columns because I dont want people who selectd multiple answers count twice because it is a select all that apply question so we want a the % of people that selected that answer not the % of all responses.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also tried a switch( true() but i need the OR in there i think.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have any suggestions or if i left anything out just let me know! thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 20:19:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-with-Text-and-multiple-OR-statements/m-p/3214345#M117331</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-01T20:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: COUNT with Text and multiple OR statements</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-with-Text-and-multiple-OR-statements/m-p/3216747#M117452</link>
      <description>&lt;P&gt;The syntax is a little off.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DIVIDE(COUNTA(Column1) , IF ( [column1]="1"  || [column2] ="1"  || [column3] ="1"  || [column4] ="1"  || [column5] ="1",count(respondents)),0)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 23:37:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-with-Text-and-multiple-OR-statements/m-p/3216747#M117452</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-05-02T23:37:51Z</dc:date>
    </item>
  </channel>
</rss>

