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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.