Forum Discussion

alucas85's avatar
alucas85
Regular Visitor
6 years ago
Solved

Indicate MAX value in time series

Good morning

I have a lot of data like this:

Datelot numbermanufactured (kg)
01/01/20201200
01/01/20202400
01/01/20203300
01/01/20204100
02/01/20205100
02/01/20206200
02/01/20207100
03/01/20208300
03/01/20209300
03/01/202010300
03/01/202011500
03/01/202012300

and so to this day. I want to get on a card the maximum or minimum value that has been manufactured in a day. In this case, you should say the MAX card: 1700kg, and MIN: 400kg

I can't find it. Thank you

  • @alucas85

    you can also try to create two measures as below.

    MAX = MAXX('Table',CALCULATE(sum('Table'[manufactured (kg)]),ALLEXCEPT('Table','Table'[Date])))
    
    MIN = MINX('Table',CALCULATE(sum('Table'[manufactured (kg)]),ALLEXCEPT('Table','Table'[Date])))

    1.PNG

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    alucas85 This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

    The pattern is:
    MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
    MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
    AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
    etc.

     

    In your case:

    Measure = 
      MINX(
        SUMMARIZE(
          'Table',
          [Date],
          "Sum",SUM([manufactured (kg)]
        ),
        [Sum]
      )
  • @alucas85

    you can also try to create two measures as below.

    MAX = MAXX('Table',CALCULATE(sum('Table'[manufactured (kg)]),ALLEXCEPT('Table','Table'[Date])))
    
    MIN = MINX('Table',CALCULATE(sum('Table'[manufactured (kg)]),ALLEXCEPT('Table','Table'[Date])))

    1.PNG

    • alucas85's avatar
      alucas85
      Regular Visitor

      Hi,

       

      And if I want it the same but instead the day, indicate the month?

       

      Thank you again

      • ryan_mayu's avatar
        ryan_mayu
        Icon for Super User rankSuper User

        alucas85 

        if you want to show the max month or min month, you can try to create a month column and use the similar DAX.

        month = year('Table'[Date])&month('Table'[Date])
        
        MAX = MAXX('Table',CALCULATE(sum('Table'[manufactured (kg)]),ALLEXCEPT('Table','Table'[month])))