cancel
Showing results for
Did you mean:
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 Number Sum of Daily Totals 41 19438 42 11117 43 11145 44 9134

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?

1 ACCEPTED SOLUTION
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!

2 REPLIES 2
Super User IV

@Niiru1 , Try like

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

Proud to be a Super User!

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!

Announcements

#### Happy New Year from Power BI

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