Forum Discussion

CScottP's avatar
CScottP
Regular Visitor
1 year ago

Max Value based upon two column and content.

TYPEACTIONMODIFICATION DATEITEMSSPLIT_MOD Expected  
WIDGET-A BASE1-Dec-24570 WIDGET-A56
WIDGET-AADDBASE1-Dec-24570 WIDGET-B75
WIDGET-ACHANGE FROM BASE1-Dec-24570 WIDGET-C0
WIDGET-ANO CHANGEBASE1-Dec-24570   
WIDGET-ACHANGE FROM CHANGE 031-Dec-24573 TOTAL131
WIDGET-ACHANGE TOCHANGE 031-Dec-24573   
WIDGET-ACHANGE TOCHANGE 041-Dec-24564   
WIDGET-ANO CHANGECHANGE 041-Dec-24564   
WIDGET-B BASE22-Dec-24230   
WIDGET-BADDBASE22-Dec-24550   
WIDGET-BCHANGE FROM BASE22-Dec-24550   
WIDGET-BNO CHANGEBASE22-Dec-24550   
WIDGET-BCHANGE FROM CHANGE 0322-Dec-24553   
WIDGET-BNO CHANGECHANGE 0322-Dec-24553   
WIDGET-BCHANGE FROM CHANGE 0422-Dec-24554   
WIDGET-BCHANGE TOCHANGE 0422-Dec-241004   
WIDGET-BCHANGE TOCHANGE 0522-Dec-24755   
WIDGET-BNO CHANGECHANGE 0522-Dec-24755   
WIDGET-CADDBASE22-Dec-24200   
WIDGET-CCHANGE FROM BASE22-Dec-24200   
WIDGET-CCHANGE TOBASE22-Dec-24200   
WIDGET-CDELETE 22-Dec-24200   

6 Replies

  • 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,

    • CScottP's avatar
      CScottP
      Regular 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. 

      • Anonymous's avatar
        Anonymous
        Not 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