Skip to main content
cancel
Showing results for 
Search instead 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

Reply
Boycie92
Resolver I
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
az38
Community Champion
Community Champion

Hi @Boycie92 

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
LinkedIn

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Boycie92 , try lastnonblankvalue

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

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

az38
Community Champion
Community Champion

Hi @Boycie92 

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
LinkedIn
harshnathani
Community Champion
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)

parry2k
Super User
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.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.