Forum Discussion

miguelsus2000's avatar
miguelsus2000
Helper III
6 years ago
Solved

Help with getting the maximum value from calculated table containing measure column

Hi... i only want to display the maximum of each group for the calculated table below.  For example, for 0000-1040I =32, for 1040O=32, 10413=43, etc.  When i use MAX it complains the Counter per BID is a measure value.  It really can't be that difficult to display these (then i'll graph them too).  Thank you... M

  • v-xuding-msft's avatar
    v-xuding-msft
    6 years ago

    Hi miguelsus2000 ,

    Miguel, I tested your sample data. Maybe the following formula can help you. For why you get the sum value, I think it is caused that my sample is too simple. It is filtered by other columns in your actual data.

     

    MAXX = 
    MAXX (
        SUMMARIZE (
            FILTER (
                ALLSELECTED ( 'LoRaBlePayload (2)' ),
                'LoRaBlePayload (2)'[Content.BeaconIdentifier]
                    IN FILTERS ( 'LoRaBlePayload (2)'[Content.BeaconIdentifier] )
            ),
            'LoRaBlePayload (2)'[Content.BeaconIdentifier],
            'LoRaBlePayload (2)'[PartitionKey],
            "New", [Count per BID]
        ),
        [New]
    )
    

    Best Regards,

    Xue Ding

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

16 Replies

  • miguelsus2000 ,

     

    Use the below meaure to get the Max value for each group:

    Measure = CALCULATE(Max(Table[Value]),ALLEXCEPT(Table,Table[Category]))
     
    Dont forget to hit THUMBS UP and Accept this as a solution if it helps you!
    • miguelsus2000's avatar
      miguelsus2000
      Helper III

      I forgot to add the table, but the Count per BID is a caluclated measure which MAX doesn't like.

       
       
       

      max4 = CALCULATE(Max('LoRaBlePayload (2)'[Count per BID]),ALLEXCEPT('LoRaBlePayload (2)','LoRaBlePayload (2)'[Content.BeaconIdentifier]))
       
      Error: Column 'Count per BID' in table 'LoRaBlePayload (2)' cannot be found or may not be used in this expression.
       

       

       

      • Tahreem24's avatar
        Tahreem24
        Super User

        miguelsus2000 ,

         

        where does Count per BID field come from? Is it coming from same table like 'LoRaBlePayload (2)?

         

        Dont forget to hit THUMBS UP and Accept this as a solution if it helps you!

    • v-xuding-msft's avatar
      v-xuding-msft
      Community Support

      Hi miguelsus2000 ,

      As I know, we will get the result that you attached while changing MAXX to SUMX. If you just use my formula but get that, can you please share a simple dummy file that we can understand clearly? 

      Use function of SUMX

      Best Regards,

      Xue Ding

      If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

      • miguelsus2000's avatar
        miguelsus2000
        Helper III

        Hi Xue.

         

        Yes, I am using MAXX, but the results look like SUMX, which i don't understand why.  Are there any settings which cause MAXX to behave similar to SUMX?  I think the formats are correct as well.

         

        Attached is a sample file and also shows the table as it's shown.

                   
                   
                   
                   
        BeaconIdentifierCreatedCreatedTimeInSecondsDevEuiMajorMinorPartitionKeyRowKeyRssiTenantTimestamp
        0000-10AB42019-12-16T22:39:19.906Z157655755970b3d5a4d31000341001336070b3d5a4d31000342.51826E+18-80Tenant12019-12-17T04:39:19.905Z
        0000-10ABV2019-12-16T22:39:19.906Z157655755970b3d5a4d31000341001338770b3d5a4d31000342.51826E+18-90Tenant12019-12-17T04:39:19.906Z
        0000-10ABW2019-12-16T22:39:19.906Z157655755970b3d5a4d3100034971338870b3d5a4d31000342.51826E+18-40Tenant12019-12-17T04:39:19.905Z
        0000-10ABW2019-12-16T22:38:19.868Z157655749970b3d5a4d3100034971338870b3d5a4d31000342.51826E+18-40Tenant12019-12-17T04:38:19.879Z

         

        This is the able view in POWERBI