Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Show latest value on card

  I have the following chart, with a card above the chart that shows average of total sick days and latest value.   The way my data model is that I have a table called Sales with colum...
  • Anonymous's avatar
    Anonymous
    4 years ago

    lukiz84 

    Thank you, yep it worked, solution below 

     

    Latest value =
    VAR maxMonthTable =
    CALCULATE(
    MONTH(MAX('Table'[MONTH/YEAR])),
    ALL('Table')
    )

    RETURN CALCULATE (
    AVERAGE ( 'Table'[SICK LEAVE TOTAL DAYS]),
    FILTER ( ALL('Table'), MONTH ( 'Table'[MONTH/YEAR]) = maxMonthTable)
    )