Forum Discussion
Anonymous
4 years agoNot applicable
Help with dax measure
Hi, I really apreciate if any one can help me with this problem
| ID School | Level | Service | Qty |
| 101 | primary school | Lunch | 20 |
| 101 | primary school | Breakfast | 18 |
| 101 | primary school | snacks | 7 |
| 101 | high school | Lunch | 30 |
| 101 | high school | Breakfast | 40 |
| 602 | primary school | Lunch | 10 |
| 602 | primary school | Breakfast | 21 |
| 602 | high school | Lunch | 25 |
| 602 | high school | Breakfast | 15 |
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
Anonymous , as I understood the ID school and schoollevel belonging together, so you can summarize them. Please take a look at Measure:
Measure = sumx( ADDCOLUMNS(SUMMARIZE(Tabelle1,Tabelle1[ID School],Tabelle1[Level]),"Total", calculate(MAX(Tabelle1[Qty]))),[Total])Hope it helps.Best regard.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])
3 Replies
- Applicable88
Impactful Individual
Anonymous , as I understood the ID school and schoollevel belonging together, so you can summarize them. Please take a look at Measure:
Measure = sumx( ADDCOLUMNS(SUMMARIZE(Tabelle1,Tabelle1[ID School],Tabelle1[Level]),"Total", calculate(MAX(Tabelle1[Qty]))),[Total])Hope it helps.Best regard.- AnonymousNot applicable
Thanks a lot!! works excelent!
- Natallia_23
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])