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
Anonymous
Not applicable

Get Last value

Hi this is a classic but can't figure it out...

 

Two unrelated tables :

   - a fact table with some controls on one side

   - another table with comments about controls (you can have many comments for 1 control)

 

I need to get the last comment in front of each control.

 

Here is a sample pbix (hope the link works)

https://1drv.ms/u/s!Amq7j4_MYYMYgUPNLNfXvj_apfWK?e=Q1PPMF

 

thanks !

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try a new column in TAB_Controls like

 

_Last_Comment = var _max = maxx(FILTER(TAB_Comment, TAB_Comment[ID Control] = TAB_Controls[ID Control] ), TAB_Comment[Date]) 
return maxx(FILTER(TAB_Comment, TAB_Comment[ID Control] = TAB_Controls[ID Control] && TAB_Comment[Date] = _max), TAB_Comment[Comment]) 

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try a new column in TAB_Controls like

 

_Last_Comment = var _max = maxx(FILTER(TAB_Comment, TAB_Comment[ID Control] = TAB_Controls[ID Control] ), TAB_Comment[Date]) 
return maxx(FILTER(TAB_Comment, TAB_Comment[ID Control] = TAB_Controls[ID Control] && TAB_Comment[Date] = _max), TAB_Comment[Comment]) 

 

Anonymous
Not applicable

Thanks @amitchandak it works !

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.

Top Solution Authors