Forum Discussion
Count how many maximums are?
It might be something very easy but I just don't know how to code. I want to calculate how many maxima there are per row.
I have the Measure to calculate the maximum value per row
= CALCULATE(MAXX(VALUES(TableSumConcept),TableSumConcept[sumConcept]))
but i need support to count how many max is per row (H)
4 Replies
- amitchandak
Super User
telesforo1969 , Assume you are using measure, M1; code to replace subtotal with max
if( not(isinscope(Date[Year])) , MAxx(values(Table[id]), [M1]), [M1])
if not subtotal
if( not(isinscope(Date[Year])) , calculate(MAxx(values(Table[id]), [M1]) , removefilters(Date[Year]) ), [M1])
- telesforo1969
Helper V
Thank you so much. I have implemented your formulas you can see it in the image.
I would appreciate your support to generate a measure to calculate how many times the maximum is repeated by ID.
The Maximo Measures:
Máximo = CALCULATE(MAXX(VALUES(DATOS), DATOS[Valor]))Maximo1 = IF(NOT(ISINSCOPE(DATOS[Año])),MAXX(VALUES(DATOS[ID]),[Máximo]),[Máximo])Maximo2 = IF(NOT(ISINSCOPE(DATOS[Año])),CALCULATE(MAXX(VALUES(DATOS[ID]),[Maximo1]),REMOVEFILTERS(DATOS[Año])),[Maximo1])Maximo3 = IF(NOT(ISINSCOPE(DATOS[Año])),CALCULATE(MAXX(VALUES(DATOS[ID]),[Máximo]),REMOVEFILTERS(DATOS[Año])),[Máximo])- telesforo1969
Helper V
the result should be: 3,1,1,1.