cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Vinagre01
New Member

Get the last non blank value based on two columns

Hello!

 

I have the following table (It's just one table. I screenshoted in different places) that I want to summarize based on the last value of two columns (Real and Target), producing other two columns in the new table with these new values.

 

Sans titre.png

Sans titre.png

Sans titre.png

Until now, I was only able to get the last value from the real column. 

 

SUMMARY = 
SUMMARIZE(Append1, Append1[NAME], "Real", LASTNONBLANKVALUE(Append1[Week], SUM(Append1[Real])))

 

 

Sans titre.png

However, I also need to get the last value from the "Target" column, also based on the last value of the "Real" column.

 

So we would get something like this

 

NAMERealTarget
FER510945
MON689530
Transferência de Peças400715

 

As you see above, the last update was made in W34 for "FER" and "MON" and in W36 for "Transferência de Peças".

 

Any idea on how to get the result above?

 

Thank you in advance

1 REPLY 1
maxigtsh
Helper I
Helper I

Hello,

 

this did the trick:

 

Real_ = LASTNONBLANKVALUE('Sample'[Week], SUM('Sample'[Real]))
Target_ = LASTNONBLANKVALUE('Sample'[Real], SUM('Sample'[Target]))
 
check.PNG
 
If this helped, please mark it as the solution, thanks 🙂

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

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

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Top Solution Authors