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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
FatherTheWizard
Resolver I
Resolver I

Column which shows the last non "x" value of the column according to table sorting

I have table that contains the columns date and column - and I would like the results in "column_wanted_result".

 

-> Basically the code should pick the latest non "x" value according to the tables sorting which is done from newest date to oldest

 

What would be the best way to do this? Preferably in M since I might need to reuse the column.

 

datecolumncolumn_wanted_result
20220201xwanted_value
20220101wanted_valuewanted_value
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@FatherTheWizard , A measure like

lastnonblankvalue(Table[date], max(Table[column]))

 

or

try a new column

lastnonblankvalue(Table[date], (Table[column]))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@FatherTheWizard , A measure like

lastnonblankvalue(Table[date], max(Table[column]))

 

or

try a new column

lastnonblankvalue(Table[date], (Table[column]))

Yep this should work if I first replace x to null. Thanks.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.