Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
webportal
Impactful Individual
Impactful Individual

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])

View solution in original post

4 REPLIES 4
webportal
Impactful Individual
Impactful Individual

@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])

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

amitchandak
Super User
Super User

@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])) )

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.