Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

MAX MIN, AVERAGE

I have the following measures. Weekly Demand is calculated correctly. But now I want to calculate Max, Min and Average Weekly Demand. Expected output : The measure should pick the Max value,...
  • Greg_Deckler's avatar
    Greg_Deckler
    3 years ago

    Anonymous OK, so let's say you want a single MAX of your MinScoreMeasure, that would be this:

    Max Min Score =
      VAR __Table = 
        SUMMARIZE(
          'Table',
          [VT Code],
          [Customer Material Code],
          [WeekNo],
          "__Min", [MinScoreMeasure]
        )
      VAR __Result = MAXX( __Table, [__Min] )
    RETURN
      __Result