Forum Discussion
vincentakatoh
9 years agoHelper IV
Query Editor: Custom column, List.Max, formula
Hi, Trying to add custom column (AttemptsMax) to show the maximum attempts per student and per subject. Need help on the custom column formula. Guess i should be using the List.Max function...
- 9 years ago
Hi vincentakatoh,
Would you like to add a calculated column in the table? I tested a formula, similar with the one below, as a calculated column in a table with 3 millions rows. It's finished in less than one minute. Maybe you can have a try.
MaxAttempts = CALCULATE ( MAX ( 'Table1'[attempts] ), FILTER ( 'Table1', 'Table1'[Student] = EARLIER ( 'Table1'[Student] ) && Table1[subject] = EARLIER ( 'Table1'[subject] ) ) )Best Regards!
Dale
v-jiascu-msft
9 years agoMicrosoft Employee
Hi vincentakatoh,
Would you like to add a calculated column in the table? I tested a formula, similar with the one below, as a calculated column in a table with 3 millions rows. It's finished in less than one minute. Maybe you can have a try.
MaxAttempts =
CALCULATE (
MAX ( 'Table1'[attempts] ),
FILTER (
'Table1',
'Table1'[Student] = EARLIER ( 'Table1'[Student] )
&& Table1[subject] = EARLIER ( 'Table1'[subject] )
)
)Best Regards!
Dale
Anonymous
6 years agoNot applicable
gOOD Day, when i apply this in power Query its giving me an expression error the Nale CALCULATE wasnt recognised