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

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

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

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors