Forum Discussion

Boycie92's avatar
Boycie92
Resolver I
6 years ago
Solved

Last Date Total

Hi,

 

I am hoping someone can help I have a very simple table.

 

I would like to be able to create a measure that would provide the figure (total) for the last date available in my data. So, in this scenario 500. Any ideas?

 

Date                  Total

1/1/2020           100 

2/1/2020           150

3/1/2020           400 

4/1/2020           500 

 

Thanks,

Boycie92

  • Hi Boycie92 

    try

    Last Date Total =
    var _lastDay = CALCULATE(MAX(Table[Date]), ALL(Table))
    
    RETURN
    CALCULATE(MAX(Table[Total]), Table[Date] = _lastDay)

4 Replies

  • Boycie92 not sure how you are going to visualize it

     

    and the following measure using one of the expression

     

     

    Max Total = 
    VAR __lastDate = CALCLULATE ( MAX ( Table[Date] ), ALL ( Table ) )
    RETURN
    CALCULATE ( SUM ( Table[Total] ), Table[Date] = __lastDate )

     

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Boycie92 ,

     

     

    Max Total =


    CALCULATE
    (
    SUM(Table[Total]), FILTER(ALL('Table'),Table[DATE] = MAX(Table[Date]))
    )
     

    Regards,
    Harsh Nathani

    Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

  • az38's avatar
    az38
    Community Champion

    Hi Boycie92 

    try

    Last Date Total =
    var _lastDay = CALCULATE(MAX(Table[Date]), ALL(Table))
    
    RETURN
    CALCULATE(MAX(Table[Total]), Table[Date] = _lastDay)