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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
saritart1
Frequent Visitor

Problem using max on a measure

Hello everyone,

 

I have the following problem: 

 

My database is organized by classes, so I have a variable that has the number of classes. (Like shown in FIGURE 1) 

 

I created a 3 measures that take the value of 1 for some cases. Now, I want to add those 1´s but BY CLASS. Now, I have been able to sum it IN TOTAL, but I want to have the value of the LAST one. This is what I did: 

 

Alta = CALCULATE(SUMX(asistencia; asistencia[Intensidad alta]);
FILTER (
ALL ( asistencia );
asistencia[Clase] <= MAX ( asistencia[Clase] )
)
)
 
where: 
asistencia[Intensidad alta] is a measure
asistencia[Clase] is a column
 
But it doesn´t work, the result is the SUM of all the 1´s.
 
I am looking for something dynamic that can change if a have a class slicer.
 
 FIGURE 1FIGURE 1

 The final goal is to create a donut chart that sums the kids that has small, medium or large attendance acording to the % of attendance (which is already calculated). I just want to classified it. 

In FIGURE 2 the circled measure is the one I want to chart. As it is a measure, it is dynamic and changes according to the number of class. I want the donut to change as well. 

 

FIGURE 2FIGURE 2

1 REPLY 1
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @saritart1

 

It seems you may try to use below measure.

Alta =
SUMX (
    FILTER (
        ALLSELECTED ( asistencia ),
        asistencia[Clase] = MAX ( asistencia[Clase] )
    ),
    asistencia[Intensidad alta]
)

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.