Forum Discussion
Get last value in date selection for a string
Hello,
I'm spending much time on doing something I've already done with numbers and now I 'm struggling to do it with text values.
I have a table (Records_Africa) with two columns, [AGILITY SCORE] and [Month].
Agility score visual should display [AGILITY SCORE] value from July 2016 because user sliced it.
[AGILITY SCORE] contains text values such as "WARNING", "EXCELLENT", "ALERT".
In my report, a date slicer uses [Month] column and this slicer is filtered by the user.
There is also a Card visual that displays Agility Score.
I want this card visual to display only LATEST value of AGILITY SCORE, within the Month slicer selection made by the user.
How can I do that please ?
PS : With numbers, formula works, it is :
Replace the AVERAGE() with a SELECTEDVALUE()?
Measure = VAR maxDate = MAX('Records_Africa'[Month]) Return CALCULATE(SELECTEDVALUE('Records_Africa'[Agility Score]); 'Records_Africa'[Month] = maxDate )But you will have an issue if there are more than 1 agility score on the same date.
16 Replies
- Greg_DecklerCommunity Champion
Just try MAX instead of LASTDATE
- Mype_powerbiFrequent Visitor
False.
The field is not numbers but text.
I think we should replace CALCULATE AVERAGE by smth else but I don't know how.
- v-lili6-msftCommunity Support
hi, Mype_powerbi
You need to add a map calculated column for [Month] for calculation or add a dim date table then create the relationship with basic data by month, and then use it for calculation.
Best Regards,
Lin