Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Extract the date from ranking

Hi experts,

I want to extract the date and put it into a card visual. I have calculated a ranking:

Ranking dia = RANKX(ALLSELECTED(Users[DtEvent]); CALCULATE(SUM(Users[QtMinutes])))


Max date = 
var a = [Ranking dia]
Return
CALCULATE(MAX(Users[DtEvent]);
    FILTER(Users; a = 1)
)

 

 

From this table I want to extract the date "21/07/2019", in my measures I have calculated "Max date" but is getting always the max date (27/07/2019).

 

What I'm missing?

  • Hi Anonymous ,

    I created a measure you can have a try.

    Measure = 
    var ma = MAX(Users[QtMinutes])
    return 
    CALCULATE(MAX(Users[DtEvent]),FILTER(Users,Users[QtMinutes] = ma))

    Best Regards,

    Xue

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

1 Reply

  • v-xuding-msft's avatar
    v-xuding-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

    I created a measure you can have a try.

    Measure = 
    var ma = MAX(Users[QtMinutes])
    return 
    CALCULATE(MAX(Users[DtEvent]),FILTER(Users,Users[QtMinutes] = ma))

    Best Regards,

    Xue

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