Sum of MAX

  • Sum of MAX

    Posted by DSC Communities on May 11, 2022 at 10:11 am
    • SAHLER Marine

      Member

      May 11, 2022 at 10:11 AM

      SOLVED :

      Hi Everyone, I’m new here…Ā 

      My problem is quite simple :
      I would like a Sum of Max passengers on bord for a Class and a Date… It’s OK with the following formula, but it cannot calculate the sum for one flight !! It give me the MAX of the class it find…Ā 

      Formula :
      NB_PAX = CALCULATE (MAX(Conso_CatSpec[Pax] ), DISTINCT(Conso_CatSpec[Flight]), DISTINCT(Conso_CatSpec[Dep.Date]))

      See attached files for an exempleĀ 

      Many thanks for your help šŸ™‚Ā 
      Marine

      ——————————
      SAHLER Marine
      ——————————

    • Olivier Aillery

      Member

      May 12, 2022 at 3:24 AM

      Hi,

      You will need the SUMX function to compute every row of your data, so it should be something like :

      Sum of MAX = SUMX( VALUES( [Class] ), CALCULATE( ALL( [Flights] ) , MAX ([Nb PAX]) ) )

      Class = Eco, premium…
      Flights = AF650YRGML
      NB Pax your measure counting pax

      Hope it helps

      ——————————
      Olivier
      ——————————
      ——————————————-

    • SAHLER Marine

      Member

      May 12, 2022 at 8:35 AM

      Hi Olivier,

      And thanks for your response.Ā 

      I’ve tried your solution but it says “A function MAX has been used in a True/False expression that is used as a table filter expression. This is not allowed.”

      If it can help, I attached an exemple of my table.Ā 

      Thanks again,
      Marine

      ——————————
      SAHLER Marine
      ——————————
      ——————————————-

    • SAHLER Marine

      Member

      May 12, 2022 at 10:48 AM

      I found something : By mixing your solution with mine, it works !

      Merci šŸ™‚

      NB_PAX_Class = SUMX( VALUES( Class[Class GƩnƩ]), CALCULATE (MAX(Conso_CatSpec[Pax] ), DISTINCT(Conso_CatSpec[Flight]), DISTINCT(Conso_CatSpec[Dep.Date])))

      Many thanks,
      Marine

      ——————————
      SAHLER Marine
      ——————————
      ——————————————-

    • Olivier Aillery

      Member

      May 12, 2022 at 12:11 PM

      De rien Marine et merci d’avoir partager la solution šŸ™‚

      ——————————
      Olivier
      ——————————
      ——————————————-

    DSC Communities replied 3 years, 10 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Sum of MAX’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!