Forum Discussion

ezequiel's avatar
ezequiel
Icon for Microsoft Employee rankMicrosoft Employee
8 years ago
Solved

Show the first bigger value

Hi,

 

I have a table with all the days of the week and some values associated to them - Sales. Basically 2 columns. I just need to show the name of the day with the higher value on the sales column. Ideally would be to show it as a Card.

 

I can't transform the original query as I need to use other data of the table to show information (A).  And I can't have a different query for this as I need to use the same filters I'm using on (A).

 

Any help on how to solve this?

 

Thanks!

 

Ezequiel

 

 

  • Hi ezequiel

     

    If you have one value against each day, these MEASURES should give you desired result in a CARD

     

    Measure =
    CALCULATE (
        VALUES ( TableName[Day] ),
        FILTER ( ALL ( TableName ), TableName[sales] = MAX ( TableName[sales] ) )
    )

     

    Alternate Measure  =
    LOOKUPVALUE ( TableName[Day], TableName[sales], MAX ( TableName[sales] ) )

6 Replies

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

    Hi ezequiel

     

    If you have one value against each day, these MEASURES should give you desired result in a CARD

     

    Measure =
    CALCULATE (
        VALUES ( TableName[Day] ),
        FILTER ( ALL ( TableName ), TableName[sales] = MAX ( TableName[sales] ) )
    )

     

    Alternate Measure  =
    LOOKUPVALUE ( TableName[Day], TableName[sales], MAX ( TableName[sales] ) )
    • ezequiel's avatar
      ezequiel
      Icon for Microsoft Employee rankMicrosoft Employee

      Hi Thanks for the help. I customized the measure script to my tables to

       

      Measure = MAXX( TopN (1, Last_30_days_activity, Last_30_days_activity[# of Requests], desc), Last_30_days_activity[weekDay] )

       

      but I'm getting a sintax error....any clue on what is wrong?

       

      Thanks again