Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Card value based on another column

Hi there,   I want to show in a card the name of the client who earned the most in a date range. I have these two tables which are DirectQueries.    I know it surely is obvious for a lot of you, ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Please Try This measure
    _name =
    VAR  _MAX =
    MAX ( 'Table_name(1)'[_CLIENTEARNINGS] )
    VAR MAX_NAME =
    CALCULATE (
    MAX ( 'Table_name'[_CLIENTEname] ),
    FILTER ( 'Table_name', 'Table_name(1)'[_CLIENTEARNINGS] = _MAX )
    )
    RETURN
    MAX_NAME

  • truptis's avatar
    4 years ago

    Hi Anonymous,

    Please try this:
    Result = var max_earning = max('tablename'[CLIENTEARNINGS])
     RETURN 

    CALCULATE (
    MAX ( 'Tablename'[CLIENTNAME] ),
    FILTER ( 'Tablename', 'Tablename'[CLIENTEARNINGS] = max_earning )
    )

    Anonymous - Please mark it as a solution, if it helps you. Thanks. 

     

    Regards,

    TruptiS