Forum Discussion
Help Needed: Creating new column to count matching values - (for example, a teacher grading a quiz)
- Anonymous4 years ago
Hi mikec007 ,
I have created a simple sample, please refer to it to see if it helps you.
Click Home>>Transform data>>Transform data.
select P1-P10, then click Transform>>unpivot columns.
Finally create two measures.
Measure = VAR _admin = CALCULATE ( MAX ( 'Table _COPY'[Value] ), FILTER ( ALL ( 'Table _COPY' ), 'Table _COPY'[name] = "admin_picks" && 'Table _COPY'[Year] = SELECTEDVALUE ( 'Table _COPY'[Year] ) && 'Table _COPY'[Week] = SELECTEDVALUE ( 'Table _COPY'[Week] ) && 'Table _COPY'[pre] = SELECTEDVALUE ( 'Table _COPY'[pre] ) ) ) RETURN IF ( MAX ( 'Table _COPY'[Value] ) = _admin, 1, 0 )Measure_2 = COUNTAX ( FILTER ( ALL ( 'Table _COPY' ), 'Table _COPY'[name] = SELECTEDVALUE ( 'Table _COPY'[name] ) && 'Table _COPY'[Year] = SELECTEDVALUE ( 'Table _COPY'[Year] ) && 'Table _COPY'[Week] = SELECTEDVALUE ( 'Table _COPY'[Week] ) && [Measure] = 1 ), [Measure] )Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi mikec007 ,
I have created a simple sample, please refer to it to see if it helps you.
Click Home>>Transform data>>Transform data.
select P1-P10, then click Transform>>unpivot columns.
Finally create two measures.
Measure =
VAR _admin =
CALCULATE (
MAX ( 'Table _COPY'[Value] ),
FILTER (
ALL ( 'Table _COPY' ),
'Table _COPY'[name] = "admin_picks"
&& 'Table _COPY'[Year] = SELECTEDVALUE ( 'Table _COPY'[Year] )
&& 'Table _COPY'[Week] = SELECTEDVALUE ( 'Table _COPY'[Week] )
&& 'Table _COPY'[pre] = SELECTEDVALUE ( 'Table _COPY'[pre] )
)
)
RETURN
IF ( MAX ( 'Table _COPY'[Value] ) = _admin, 1, 0 )
Measure_2 =
COUNTAX (
FILTER (
ALL ( 'Table _COPY' ),
'Table _COPY'[name] = SELECTEDVALUE ( 'Table _COPY'[name] )
&& 'Table _COPY'[Year] = SELECTEDVALUE ( 'Table _COPY'[Year] )
&& 'Table _COPY'[Week] = SELECTEDVALUE ( 'Table _COPY'[Week] )
&& [Measure] = 1
),
[Measure]
)
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you! I wanted to let you know I'm still working with this possibly solution. I will provide an update when I have better feedback from my testing. Your assistance is much appreciated!
- mikec0074 years ago
Microsoft Employee
This was the stepping stone to exactly what we were trying to achieve. Thank you very much for this guidance!