Forum Discussion
Max Value based upon two column and content.
| TYPE | ACTION | MODIFICATION | DATE | ITEMS | SPLIT_MOD | Expected | ||
| WIDGET-A | BASE | 1-Dec-24 | 57 | 0 | WIDGET-A | 56 | ||
| WIDGET-A | ADD | BASE | 1-Dec-24 | 57 | 0 | WIDGET-B | 75 | |
| WIDGET-A | CHANGE FROM | BASE | 1-Dec-24 | 57 | 0 | WIDGET-C | 0 | |
| WIDGET-A | NO CHANGE | BASE | 1-Dec-24 | 57 | 0 | |||
| WIDGET-A | CHANGE FROM | CHANGE 03 | 1-Dec-24 | 57 | 3 | TOTAL | 131 | |
| WIDGET-A | CHANGE TO | CHANGE 03 | 1-Dec-24 | 57 | 3 | |||
| WIDGET-A | CHANGE TO | CHANGE 04 | 1-Dec-24 | 56 | 4 | |||
| WIDGET-A | NO CHANGE | CHANGE 04 | 1-Dec-24 | 56 | 4 | |||
| WIDGET-B | BASE | 22-Dec-24 | 23 | 0 | ||||
| WIDGET-B | ADD | BASE | 22-Dec-24 | 55 | 0 | |||
| WIDGET-B | CHANGE FROM | BASE | 22-Dec-24 | 55 | 0 | |||
| WIDGET-B | NO CHANGE | BASE | 22-Dec-24 | 55 | 0 | |||
| WIDGET-B | CHANGE FROM | CHANGE 03 | 22-Dec-24 | 55 | 3 | |||
| WIDGET-B | NO CHANGE | CHANGE 03 | 22-Dec-24 | 55 | 3 | |||
| WIDGET-B | CHANGE FROM | CHANGE 04 | 22-Dec-24 | 55 | 4 | |||
| WIDGET-B | CHANGE TO | CHANGE 04 | 22-Dec-24 | 100 | 4 | |||
| WIDGET-B | CHANGE TO | CHANGE 05 | 22-Dec-24 | 75 | 5 | |||
| WIDGET-B | NO CHANGE | CHANGE 05 | 22-Dec-24 | 75 | 5 | |||
| WIDGET-C | ADD | BASE | 22-Dec-24 | 20 | 0 | |||
| WIDGET-C | CHANGE FROM | BASE | 22-Dec-24 | 20 | 0 | |||
| WIDGET-C | CHANGE TO | BASE | 22-Dec-24 | 20 | 0 | |||
| WIDGET-C | DELETE | 22-Dec-24 | 20 | 0 |
6 Replies
- DataNinja777Super User
Hi CScottP ,
It looks like you want to find the maximum value in the ITEMS column based on the TYPE and MODIFICATION columns. From your provided data, it seems like the Expected column reflects the highest ITEMS value for each TYPE.
To clarify, should the logic be:
For each TYPE, find the maximum ITEMS value across all rows where MODIFICATION is the same?
If so, should we group by MODIFICATION first or just take the max ITEMS per TYPE?
Let me know, and I can propose the correct dax formula.Best regards,
- CScottPRegular Visitor
After googling the internet from end to end I wasn't able to find which way to go about it. I've done power query sorting, groups, Max value, filters and not found a way to go about it to get desired results.
- AnonymousNot applicable
Hi CScottP,
Here is the measure formula to calculate max 'ITEMS' based on current 'TYPE' and 'MODIFICATION' group and filters on the table. You can try it if helps:
formula = CALCULATE ( MAX ( Table1[ITEMS] ), ALLSELECTED ( Table1 ), VALUES ( Table1[TYPE] ), VALUES ( Table1[MODIFICATION] ) )If these also don't help, please share more detailed information and description to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng