Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Pick highest value by ID

Hello,

I have a sample table as follows :

ClientIDValue
A12350
A12390
B00070
B000100

 

I want a table that returns

Client  Value

A  90

B  100

 

Thanks in advance,

 

 

 

  • Hi, Adnane_k

    You can try the following methods:

    1. Create a new calculation column to calculate the maximum value of each group of clients, and the results are shown in the figure:
    Max Value = 
    CALCULATE( 
        MAX([Value]), 
        FILTER(
            'Table', 
            'Table'[Client] = EARLIER('Table'[Client]) 
        ) 
    )
    

    1.  When creating a visual, the selection of measures is not summed, and the results are as shown in the figure:

    If the method I provided above can't solve your problem, what's your expected result? Could you please provide more details for it?

    Best Regards,

    Charlotte Zhang

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

     

     

5 Replies

  • Hi,

    Please check the below picture for creating a new table.

     

     

    New Table =
    GROUPBY (
    'Table',
    'Table'[Client],
    "@MaxValue", MAXX ( CURRENTGROUP (), 'Table'[Value] )
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello, thank you for your answer but I don't want to create a new table. Also it doesn't give the correct values

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

     

    Create a measure for this:

     

    Max_grp = CALCULATE(MAX(Table[Value]),ALLEXCEPT(Table,Table[Client]))

     

    And then drag the Client column and the above measure to get the desired result.

     

    Thanks

    Raj

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello , it doesn't work. Maybe because in my real data I have 20 other columns and use "fiscal year" in the slicer.

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, Adnane_k

    You can try the following methods:

    1. Create a new calculation column to calculate the maximum value of each group of clients, and the results are shown in the figure:
    Max Value = 
    CALCULATE( 
        MAX([Value]), 
        FILTER(
            'Table', 
            'Table'[Client] = EARLIER('Table'[Client]) 
        ) 
    )
    

    1.  When creating a visual, the selection of measures is not summed, and the results are as shown in the figure:

    If the method I provided above can't solve your problem, what's your expected result? Could you please provide more details for it?

    Best Regards,

    Charlotte Zhang

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