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
owais
Regular Visitor

Unexpected result of 'lastnonblank' formula

Hi

 

I am getting an strange or unexpected result in calculated column in 'lastnonblank' formula. Bilow is the picture describing the problem.project table.png

 

'Last update date' column is also a calculated column using last date formula but same formula is resulting wrong value in next column. How I can fix this error?

 

n.b. Relation between both table is 1 to many.

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @owais,

 

Please create a calculated column use LOOKUPVALUE( ):

 

current status = LOOKUPVALUE('updates'[Update Status],'updates'[Project Name],'Table1'[Project Name],'updates'[Update Date],'Table1'[last update date])

 

q1.PNG

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-qiuyu-msft
Community Support
Community Support

Hi @owais,

 

Please create a calculated column use LOOKUPVALUE( ):

 

current status = LOOKUPVALUE('updates'[Update Status],'updates'[Project Name],'Table1'[Project Name],'updates'[Update Date],'Table1'[last update date])

 

q1.PNG

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-qiuyu-msft

 

Thanks for perfect reply. Its working with lookup. But could you explain what was wrong in my formula? and another thing, if there are 2 or more entries in same date for same project, which wone it will take?

 

Thanks

Hi @owais,

 

The LASTNONBLANK() function is used for returning the last value in the column, column, filtered by the current context, where the expression is not blank.

 

Regarding the calculated column:

 

Column = LASTNONBLANK('updates'[Update Status],LASTDATE('updates'[Update Date]))

 

As 'updates'[Update Status] is TEXT, it will sort 'updates'[Update Status] values based on the first character within each project. So that's the issue why you didn't get desired results.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.