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
cryptosun
Helper I
Helper I

Getting the Most recent Comment in PowerBI!

Dear Experts, Can someone help me? Its quite urgent

 

I have a PowerBI Report, Containing 3 data sources. 

One datasource is SQL, and other 2 are sharepoint lists.

 

There are around 20 columns in SQL Datasource, while I have used other 2 sharepoint, where the customer and supplier comments are stored.

 

I have embed 2 powerapps in PowerBI report which takes the comments based on the click of an entry in the report and fetch 4-5 columns and just asks for a comment which is saved in the sharepoint, Plus its shown in the report as well.

 

The problem is, now i can see all the comments of Customers and Suppliers in the report.

 

I would like to a measure to show only the recent comment for both customer and supplier column.

 

 

I tried to use this dax statement but it gives an error at the end, I am not sure what i am doing wrong.

 

LatestComment =
VAR _maxDate = CALCULATE(MAX(SharepointListofComments[Date Column Stored in Sharepoint List]), FILTER(ALL(SharepointListofComments),CSharepointListofComments[comment colum] = MAX(SharepointListofComments[commentcolumn])))

RETURN
IF(MAX(SharepointListofComments[datecolumn]= _maxDate,1,0))

Can someone help me with the issue its been a longtime, i am trying to find a solution but still no luck.

 

I would be grateful for your help

2 REPLIES 2
amitchandak
Super User
Super User

@cryptosun , corrected one syntax error

 

LatestComment =
VAR _maxDate = CALCULATE(MAX(SharepointListofComments[Date Column Stored in Sharepoint List]), FILTER(ALL(SharepointListofComments),CSharepointListofComments[comment colum] = MAX(SharepointListofComments[commentcolumn])))

RETURN
IF(MAX(SharepointListofComments[datecolumn])= _maxDate,1,0)

Thankyou for the reply, it shows just 1 in the latest comment in the table, How can i show just the latest comment in the comments of suppliers and customer? So i guess its just a flag, how can i apply it to the comments of suppliers and customer column so the only recent comment is shown instead of all comments. TIA

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.