cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

LASTNONBLANK VALUE or max of column value

I'm currently trying to get the last value in each column to be displayed via the following measure:

 

Latest Sum of Daily Totals = LASTNONBLANK(pg14[Sum of Daily totals],CALCULATE(SUM('pg14'[Sum of Daily totals])))
 
My table looks like this:
Week NumberSum of Daily Totals
4119438
4211117
4311145
449134

 

 

However when I run this formula I get the second last value 11145 and not the last 9134 which is the one I need, does anyone know how to do this?

 

Thanks in advance

1 ACCEPTED SOLUTION
Super User IV
Super User IV

You need to use LASTNONBLANKVALUE.  Please try this measure expression in a card visual, replacing Daily for your actual table name.

 

LNB = LASTNONBLANKVALUE(Daily[Week Number], MAX(Daily[Sum of Daily Totals]))
 
Regards,
Pat




Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
Super User IV
Super User IV

@Niiru1 , Try like

Latest Sum of Daily Totals = LASTNONBLANKVALUE(pg14[Week Number],CALCULATE(SUM('pg14'[Sum of Daily totals])))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Super User IV
Super User IV

You need to use LASTNONBLANKVALUE.  Please try this measure expression in a card visual, replacing Daily for your actual table name.

 

LNB = LASTNONBLANKVALUE(Daily[Week Number], MAX(Daily[Sum of Daily Totals]))
 
Regards,
Pat




Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors