Forum Discussion

AllanBerces's avatar
AllanBerces
Icon for Post Prodigy rankPost Prodigy
2 years ago
Solved

Max No. per Week

Hi good day,

Can pls someone help me on my measure. I have table i want to get the max no. of pax per week

My Table:

Output using measure

Thank you

  • Hi AllanBerces - calculate the maximum number of Pax per week for each Trade , you can create below measure

     

    please replace with your table name as per your model.

     

    MaxPaxPerTrade1 =
    SUMX(
        SUMMARIZE(
            'Trad',
            'Trad'[Trade],
            'Trad'[WeekNo.],
            "MaxPax", MAX('Trad'[Pax])
        ),
        [MaxPax]
    )

     

     

    output:

     

    Hope it helps.

     

     

3 Replies

  • Hi AllanBerces - calculate the maximum number of Pax per week for each Trade , you can create below measure

     

    please replace with your table name as per your model.

     

    MaxPaxPerTrade1 =
    SUMX(
        SUMMARIZE(
            'Trad',
            'Trad'[Trade],
            'Trad'[WeekNo.],
            "MaxPax", MAX('Trad'[Pax])
        ),
        [MaxPax]
    )

     

     

    output:

     

    Hope it helps.

     

     

  • Hi AllanBerces ,

    --returns the max per week regardless of other columns in the visual 
    CALCULATE ( MAX ( 'table'[pax] ), ALLEXCEPT ( 'table', 'table'[Week No.] ) )
    
    --returns the max per week per trade per area 
    CALCULATE (
        MAX ( 'table'[pax] ),
        ALLEXCEPT ( 'table', 'table'[Week No.], 'table'[trade], 'table'[area] )
    )