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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Help with dax measure

Hi, I really apreciate if any one can help me with this problem

 

ID SchoolLevelServiceQty
101primary schoolLunch20
101primary schoolBreakfast18
101primary schoolsnacks7
101high schoolLunch30
101high schoolBreakfast40
602primary schoolLunch10
602primary schoolBreakfast21
602high schoolLunch25
602high schoolBreakfast15


Max qty by service in
ID 101
for primary school is 20,
For high shcool is 40 
in ID 602 
for primary school is 21,
For high shcool is 25

 

Expected measure result is 20+40+21+25 =106 

2 ACCEPTED SOLUTIONS
Applicable88
Impactful Individual
Impactful Individual

@Anonymous , as I understood the ID school and schoollevel belonging together, so you can summarize them. Please take a look at Measure:

 

Applicable88_0-1633536350999.png

 

Measure = sumx( ADDCOLUMNS(SUMMARIZE(Tabelle1,Tabelle1[ID School],Tabelle1[Level]),"Total", calculate(MAX(Tabelle1[Qty]))),[Total])
 
Hope it helps.
Best regard. 

 

View solution in original post

Natallia_23
Resolver I
Resolver I

Hello,

 

Max = CALCULATE(MAX(Table1[Qty]),ALLEXCEPT(Table1,Table1[ID],Table1[School Level]))
 
Result =
var x = SUMMARIZECOLUMNS(Table1[ID],Table1[School Level], "res", [Max] )
return sumx(x, [res])
 
Natallia_23_0-1633537400084.png

 

View solution in original post

3 REPLIES 3
Natallia_23
Resolver I
Resolver I

Hello,

 

Max = CALCULATE(MAX(Table1[Qty]),ALLEXCEPT(Table1,Table1[ID],Table1[School Level]))
 
Result =
var x = SUMMARIZECOLUMNS(Table1[ID],Table1[School Level], "res", [Max] )
return sumx(x, [res])
 
Natallia_23_0-1633537400084.png

 

Applicable88
Impactful Individual
Impactful Individual

@Anonymous , as I understood the ID school and schoollevel belonging together, so you can summarize them. Please take a look at Measure:

 

Applicable88_0-1633536350999.png

 

Measure = sumx( ADDCOLUMNS(SUMMARIZE(Tabelle1,Tabelle1[ID School],Tabelle1[Level]),"Total", calculate(MAX(Tabelle1[Qty]))),[Total])
 
Hope it helps.
Best regard. 

 

Anonymous
Not applicable

Thanks a lot!! works excelent!

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.