cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Resolver I

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

1 ACCEPTED SOLUTION
Community Champion

try

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

RETURN
CALCULATE(MAX(Table[Total]), Table[Date] = _lastDay)``````

do not hesitate to give a kudo to useful posts and mark solutions as solution
4 REPLIES 4
Super User

@Boycie92 , try lastnonblankvalue

https://docs.microsoft.com/en-us/dax/lastnonblankvalue-function-dax

lastnonblankvalue(Table[Date],sum(Table[Total])

Community Champion

try

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

RETURN
CALCULATE(MAX(Table[Total]), Table[Date] = _lastDay)``````

do not hesitate to give a kudo to useful posts and mark solutions as solution
Community Champion

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)

Super User

@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!

Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤

Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.