cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
webportal
Post Prodigy
Post Prodigy

Get the last non blank value of a column

This is my table:

 

webportal_0-1614688718599.png

 

For each "No", I want to get the value of column "Data" that is non-blank.

 

For example, for "No" = 1203210:

 

webportal_1-1614688793359.png

 

That value would be 30/04/2016

 

And for "No" = 1202547:

 

webportal_2-1614688850153.png

 

The value would be: 31/01/2017.

 

Thus, the results I'm expecting are supposed to be shown on an additional calculated column:

webportal_3-1614689029592.png

 

1 ACCEPTED SOLUTION

@webportal , Try like

maxx(filter(Table, [No] =earlier([No]) && not(isblank(Table[Class]))),[Date])



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!

View solution in original post

4 REPLIES 4
webportal
Post Prodigy
Post Prodigy

@amitchandak 

I need a CALCULATED COLUMN.

That expression returns an error when typed into a calculated column: "A circular reference was detected..."

@webportal , Try like

maxx(filter(Table, [No] =earlier([No]) && not(isblank(Table[Class]))),[Date])



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!

View solution in original post

That's a lot better!
It also works with an intermediate table 😉

amitchandak
Super User IV
Super User IV

@webportal , You can try measures like

 

Measure =
VAR __id = MAX ('Table'[No] )
VAR __date = CALCULATE ( MAX('Table'[date] ), ALLSELECTED ('Table' ), 'Table'[No] = __id , not(isblank(Table[Class])))
RETURN CALCULATE ( Max ('Table'[date] ), VALUES ('Table'[No] ),'Table'[No] = __id,'Table'[date] = __date, not(isblank(Table[Class])) )



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!

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors