Forum Discussion

miguelsus2000's avatar
miguelsus2000
Helper III
6 years ago
Solved

Need help extracting Max Value.

Hi,

 

I'm trying to create a column in the bottom table which displays the maximum value under "Count per BID" for every PartitionKey value.  For example, i selected PartitionKey 70b...120, and the maximum Count per BID (see table above) is 61, so i'd like to display "61" in a column for that PartitionKey.  Can someone help me with the formula?  I'm stuck with Max3 and Max5, but the values are incorrect.  Thank you.

 

 

 

max3 =

CALCULATE (

    MAXx( 'LoRaBlePayload (2)', COUNTx('Key Measures', [Count per BID] )),

    ALLEXCEPT (

        'LoRaBlePayload (2)',

        'LoRaBlePayload (2)'[PartitionKey]

    )

)

 

 

Max5 =

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]

)

 

  • Hi,

     

    Perhaps I am oversimplifying things, but this is my result:

    MaxOfPartitionKey = maxx(SUMMARIZE('Table';'Table'[PartitionKey];'Table'[Identifier]);CALCULATE(COUNT('Table'[BID])))

     

    As can be seen here:

    Power BI file available here.

     

    Please accept as solution if this is what you are looking for. Thanks.

     

    Kind regards,

     

    Steve. 

2 Replies

  • stevedep's avatar
    stevedep
    Memorable Member

    Hi,

     

    Perhaps I am oversimplifying things, but this is my result:

    MaxOfPartitionKey = maxx(SUMMARIZE('Table';'Table'[PartitionKey];'Table'[Identifier]);CALCULATE(COUNT('Table'[BID])))

     

    As can be seen here:

    Power BI file available here.

     

    Please accept as solution if this is what you are looking for. Thanks.

     

    Kind regards,

     

    Steve.