<?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: Help Needed:  Creating new column to count matching values - (for example, a teacher grading a quiz) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-Creating-new-column-to-count-matching-values-for/m-p/2684463#M80511</link>
    <description>&lt;P&gt;This was the stepping stone to exactly what we were trying to achieve.&amp;nbsp; Thank you very much for this guidance!&lt;/P&gt;</description>
    <pubDate>Fri, 05 Aug 2022 15:01:18 GMT</pubDate>
    <dc:creator>mikec007</dc:creator>
    <dc:date>2022-08-05T15:01:18Z</dc:date>
    <item>
      <title>Help Needed:  Creating new column to count matching values - (for example, a teacher grading a quiz)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-Creating-new-column-to-count-matching-values-for/m-p/2663417#M79051</link>
      <description>&lt;P&gt;Hi! I have a Power App that collects responses from users (similiar to a student taking a quiz/test).&amp;nbsp; Their submissions are stored in a dataverse, one entry = one row of data.&amp;nbsp; The data produces a table that looks similar to the following.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;NOTES:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;In this example, Johnny and Sam have made selections for two weeks worth of "quizzes" and therefor have two rows of data. &amp;nbsp;(Think of these rows like the responses to test questions).&lt;/LI&gt;&lt;LI&gt;“admin_picks” are the selections I would put in for each week's "quiz". (think of these rows as the quiz's answer keys).&lt;/LI&gt;&lt;LI&gt;Each row where a user's YEAR and WEEK match the "admin_picks" YEAR and WEEK would compare values and count matches.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to find a method to programmatically determine Johnny and Sam’s scores by comparing them to the corresponding row “admin_picks” (WHERE 'year' and 'week' would be the same 'year' and 'week' as Johnny and Sam's answers submissions).&amp;nbsp; I could then rank users based on weekly correct responses and grand totals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output would look like the following table (Ideally, the DAX/Report code would be configured in such a way where I could simply refresh the data and the table below would be dynamically updated based on any new entries in the dataverse.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Year&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Name&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;score_week1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;score_week2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;grand_total&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2022&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;6&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;6&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;12&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2022&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Johnny&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;6&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;5&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;11&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Warning:&amp;nbsp; I am an App maker and not proficient in DAX (I'm just learning PowerBI at this point, but have a background in SSRS and SQL query), so I may be out of my league a bit, but I feel like my background gets me close logically.&amp;nbsp; If I had some advice/guidance to help push me along, I might be able to achieve this.&amp;nbsp; Thanks for reading and any guidance/help is appreciated! -Mike&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 13:54:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-Creating-new-column-to-count-matching-values-for/m-p/2663417#M79051</guid>
      <dc:creator>mikec007</dc:creator>
      <dc:date>2022-07-27T13:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed:  Creating new column to count matching values - (for example, a teacher grading a quiz)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-Creating-new-column-to-count-matching-values-for/m-p/2668454#M79489</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="412470" data-lia-user-login="mikec007" class="lia-mention lia-mention-user"&gt;mikec007&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I have created a simple sample, please refer to it to see if it helps you.&lt;/P&gt;
&lt;P&gt;Click Home&amp;gt;&amp;gt;Transform data&amp;gt;&amp;gt;Transform data.&lt;/P&gt;
&lt;P&gt;select P1-P10, then click Transform&amp;gt;&amp;gt;unpivot columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Finally create two measures.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _admin =
    CALCULATE (
        MAX ( 'Table _COPY'[Value] ),
        FILTER (
            ALL ( 'Table _COPY' ),
            'Table _COPY'[name] = "admin_picks"
                &amp;amp;&amp;amp; 'Table _COPY'[Year] = SELECTEDVALUE ( 'Table _COPY'[Year] )
                &amp;amp;&amp;amp; 'Table _COPY'[Week] = SELECTEDVALUE ( 'Table _COPY'[Week] )
                &amp;amp;&amp;amp; 'Table _COPY'[pre] = SELECTEDVALUE ( 'Table _COPY'[pre] )
        )
    )
RETURN
    IF ( MAX ( 'Table _COPY'[Value] ) = _admin, 1, 0 )
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Measure_2 =
COUNTAX (
    FILTER (
        ALL ( 'Table _COPY' ),
        'Table _COPY'[name] = SELECTEDVALUE ( 'Table _COPY'[name] )
            &amp;amp;&amp;amp; 'Table _COPY'[Year] = SELECTEDVALUE ( 'Table _COPY'[Year] )
            &amp;amp;&amp;amp; 'Table _COPY'[Week] = SELECTEDVALUE ( 'Table _COPY'[Week] )
            &amp;amp;&amp;amp; [Measure] = 1
    ),
    [Measure]
)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team _ Polly&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 02:54:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-Creating-new-column-to-count-matching-values-for/m-p/2668454#M79489</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-29T02:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed:  Creating new column to count matching values - (for example, a teacher grading a quiz)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-Creating-new-column-to-count-matching-values-for/m-p/2675513#M79916</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp; I wanted to let you know I'm still working with this possibly solution.&amp;nbsp; I will provide an update when I have better feedback from my testing.&amp;nbsp; Your assistance is much appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 12:14:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-Creating-new-column-to-count-matching-values-for/m-p/2675513#M79916</guid>
      <dc:creator>mikec007</dc:creator>
      <dc:date>2022-08-02T12:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed:  Creating new column to count matching values - (for example, a teacher grading a quiz)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-Creating-new-column-to-count-matching-values-for/m-p/2684463#M80511</link>
      <description>&lt;P&gt;This was the stepping stone to exactly what we were trying to achieve.&amp;nbsp; Thank you very much for this guidance!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 15:01:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-Creating-new-column-to-count-matching-values-for/m-p/2684463#M80511</guid>
      <dc:creator>mikec007</dc:creator>
      <dc:date>2022-08-05T15:01:18Z</dc:date>
    </item>
  </channel>
</rss>

