<?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: Customer survey only valid answers (horizontal COUNTIF) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-survey-only-valid-answers-horizontal-COUNTIF/m-p/1569320#M31261</link>
    <description>&lt;P&gt;I looked at the Kaggle data and made a simple pbix that may get you started.&amp;nbsp; Just replace the path in the Source line of the RawData query to point to your local download of the file.&amp;nbsp; It splits the data into two tables (traveler and survey), which is how you should modle these data IMO).&amp;nbsp; I also made a DAX column to show if a traveler's response is considered valid or not based on your criteria (all responses were in the test.csv file).&amp;nbsp; There is also a measure that calculated the average response, excluding responses of 0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;</description>
    <pubDate>Thu, 24 Dec 2020 16:37:29 GMT</pubDate>
    <dc:creator>mahoneypat</dc:creator>
    <dc:date>2020-12-24T16:37:29Z</dc:date>
    <item>
      <title>Customer survey only valid answers (horizontal COUNTIF)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-survey-only-valid-answers-horizontal-COUNTIF/m-p/1569100#M31254</link>
      <description>&lt;P&gt;Hi, i need help with the following issue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the&amp;nbsp;&lt;A href="https://www.kaggle.com/teejmahal20/airline-passenger-satisfaction" target="_blank" rel="noopener"&gt;https://www.kaggle.com/teejmahal20/airline-passenger-satisfaction&lt;/A&gt;&amp;nbsp;dataset and try to solve the following problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The customers can rank 15 topics from 0 - 5. I guess, 0 stands for "no answer" or "I&amp;nbsp; didn't use the service". So I decided to leave answers with a 0 out of the calculation and only count the &lt;STRONG&gt;valid answers.&lt;/STRONG&gt; The idea is to get&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; an average for only answered questions and&lt;/P&gt;&lt;P&gt;&amp;gt; get a threshold, that counts an individual customerfeedback as invalid e.g. if e.g. 50% or less of the questions haven't been answered&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to calculate as follows:&amp;nbsp;average score = total score* divided by the &lt;STRONG&gt;valid number&lt;/STRONG&gt; of ratings, means all given ratings except 0.&lt;/P&gt;&lt;P&gt;*) total score is a calcuated column in Power Query&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID 1 = (5 + 4 + 3 + 5) / &lt;STRONG&gt;4 valid answers&lt;/STRONG&gt;&amp;nbsp; = 4.25 average rating&lt;/P&gt;&lt;P&gt;ID 3 = (2 + 4 + 0 + 3) / &lt;STRONG&gt;3&amp;nbsp;valid answers&lt;/STRONG&gt; = 3 average rating&lt;/P&gt;&lt;P&gt;ID 2 and 4 = &lt;STRONG&gt;only 2 valid answers&lt;/STRONG&gt; -&amp;gt; invalid feedback (&amp;lt;=50%)&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&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;&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;&lt;P&gt;That's a piece of cake in Excel with a horizontal COUNTIF function. But in DAX I cannot figure out a pretty solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I got and it works, but I am quite sure, there are solutions much smarter and more performat too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Valid Answer&lt;/STRONG&gt; =&lt;/P&gt;&lt;P&gt;VAR A = IF(table[columnA] = 0, 1, 0)&lt;/P&gt;&lt;P&gt;VAR B = IF(table[columnB] = 0, 1, 0)&lt;/P&gt;&lt;P&gt;VAR C = IF(table[columnC] = 0, 1, 0)&lt;/P&gt;&lt;P&gt;VAR D = IF(table[columnD] = 0, 1, 0)&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;4 - (A + B + C + D)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I highly appreciate your feedback and wish you peaceful days and a good start into 2021!&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;&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;&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;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2020 13:07:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-survey-only-valid-answers-horizontal-COUNTIF/m-p/1569100#M31254</guid>
      <dc:creator>datadonuts</dc:creator>
      <dc:date>2020-12-24T13:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Customer survey only valid answers (horizontal COUNTIF)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-survey-only-valid-answers-horizontal-COUNTIF/m-p/1569113#M31255</link>
      <description>&lt;P&gt;Since you are using a public dataset, it would be easier if you could share your pbix file.&amp;nbsp; Can you add a link to it on OneDrive, Google Drive, etc.?&amp;nbsp; If so, a specific expression can be suggested.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2020 13:22:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-survey-only-valid-answers-horizontal-COUNTIF/m-p/1569113#M31255</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-12-24T13:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Customer survey only valid answers (horizontal COUNTIF)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-survey-only-valid-answers-horizontal-COUNTIF/m-p/1569232#M31260</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="244606" data-lia-user-login="datadonuts" class="lia-mention lia-mention-user"&gt;datadonuts&lt;/a&gt;&amp;nbsp;, as you know, DAX runs on&amp;nbsp;xVelocity in-memory columnar analytic engine, which inherently favors columns of data. Just unpivot columns food, drink etc, then it's ready to be sliced and diced with DAX.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2020 14:50:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-survey-only-valid-answers-horizontal-COUNTIF/m-p/1569232#M31260</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2020-12-24T14:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Customer survey only valid answers (horizontal COUNTIF)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-survey-only-valid-answers-horizontal-COUNTIF/m-p/1569320#M31261</link>
      <description>&lt;P&gt;I looked at the Kaggle data and made a simple pbix that may get you started.&amp;nbsp; Just replace the path in the Source line of the RawData query to point to your local download of the file.&amp;nbsp; It splits the data into two tables (traveler and survey), which is how you should modle these data IMO).&amp;nbsp; I also made a DAX column to show if a traveler's response is considered valid or not based on your criteria (all responses were in the test.csv file).&amp;nbsp; There is also a measure that calculated the average response, excluding responses of 0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2020 16:37:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-survey-only-valid-answers-horizontal-COUNTIF/m-p/1569320#M31261</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-12-24T16:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Customer survey only valid answers (horizontal COUNTIF)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-survey-only-valid-answers-horizontal-COUNTIF/m-p/1569366#M31265</link>
      <description>&lt;P&gt;Thank you for the genious reply. I will check out your channel.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;&lt;P&gt;All the best to you for 2021!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2020 17:32:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-survey-only-valid-answers-horizontal-COUNTIF/m-p/1569366#M31265</guid>
      <dc:creator>datadonuts</dc:creator>
      <dc:date>2020-12-24T17:32:16Z</dc:date>
    </item>
  </channel>
</rss>

