Forum Discussion

fangtasteeq's avatar
fangtasteeq
Regular Visitor
5 years ago
Solved

lookup max value based on Measure

Hi, I have a Measure (Volume) that is calculated based on the Time of Day and some other dataset, and now I need to get the value of Time of Day when Volume is Maximized, in this example I need a cell that shows 11:45AM.

 

Is there any way to achieve this? It can probably be done quite easily if Volume was a column, but I need it to be a Measure for filtering purposes.

 

  • Hi, fangtasteeq , perhaps you might want to use TOPN func to achieve the goal in this pattern,

    Time of Max Volumn =
    MAXX (
        TOPN ( 1, VALUES ( 'Table'[Time of Day] ), [Volume] ),
        'Table'[Time of Day]
    )

     

2 Replies

  • CNENFRNL's avatar
    CNENFRNL
    Community Champion

    Hi, fangtasteeq , perhaps you might want to use TOPN func to achieve the goal in this pattern,

    Time of Max Volumn =
    MAXX (
        TOPN ( 1, VALUES ( 'Table'[Time of Day] ), [Volume] ),
        'Table'[Time of Day]
    )