Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
telesforo1969
Helper V
Helper V

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)

 

 

ContarMax.JPG

4 REPLIES 4
amitchandak
Super User
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])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you so much. I have implemented your formulas you can see it in the image.

 

ContarMax1.JPG

 

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])

the result should be: 3,1,1,1.

 

ContarMax2.JPG

I got it

ContarMax3.JPG

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors