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
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

March Update

Check it Out!

Click here to read more about the March 2021 Updates!

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.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.