Forum Discussion
telesforo1969
Helper V
3 years agoCount 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(...
amitchandak
Super User
3 years agotelesforo1969 , 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])
- telesforo19693 years ago
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])- telesforo19693 years ago
Helper V
the result should be: 3,1,1,1.
- telesforo19693 years ago
Helper V
I got it