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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Yeswanth
Frequent Visitor

i want to see the latest comments in powerbi table

I want to showcase the recent comments in table. initially in every ticket we have multiple updates when customer posted their updates in each row, we have the multiple comments and multiple timestamp's specific to the ID . table .png

I want to showcase the recent comments in table.

1 ACCEPTED SOLUTION

Hi @Yeswanth 

 

Thanks for the reply from @Ashish_Mathur , please allow me to provide another insight:

 

I used the latest data you gave, which according to my tests requires you to have a corresponding ID for each comment, otherwise the following will happen.

vxuxinyimsft_0-1713165532504.png

 

no corresponding ID for each row:

vxuxinyimsft_3-1713166524969.png

 

1. Create a calculated column as follows

 

Date = LEFT([Comments], 19)

 

 

2. Create a measure as follows

 

Measure = 
VAR _max = CALCULATE(MAX([Date]), ALLEXCEPT('Table', 'Table'[ID]))
RETURN
IF(MAX([Date]) = _max, 1, 0)

 

 

3. Put the measure into the filter so that the visual only shows data where the measure is equal to 1.

vxuxinyimsft_1-1713166268792.png

 

Result:

vxuxinyimsft_2-1713166295621.png

 

Best Regards,
Yulia Xu

 

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

10 REPLIES 10
Ashish_Mathur
Super User
Super User

Hi,

I am not sure how much i can help but i would like to try.  Share data in a format that can be pasted in an MS Excel file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur please find the below table wihich shows actual vs expected result. please provide the desired dax ? or any suggestions thanks
Actual Data

IDComments
22872024-01-16 13:17:59 - Kumar (Additional comments)
such as children and the elderly, and marginalized communities, because polluting industries and toxic waste sites tend

2024-01-09 13:51:35 - Rakesh (Additional comments)
Many sources of pollution were unregulated parts of industrialization during the 19th and 20th centuries until the emergence of environmental regulation and pollution policy in the later half of the 20th century.

2024-01-03 10:20:26 - Rakesh (Additional comments)
Pollution has widespread consequences on human and environmental health, having systematic impact on social and economic systems.

2023-12-19 14:11:44 - Rakesh (Additional comments)
Although environmental pollution can be caused by natural events, the word pollution generally implies that the contamin

2023-12-12 12:35:37 - kumar (Additional comments)
Pollution is the introduction of contaminants into the natural environment that cause adverse change.[1]
22882024-01-13 13:17:59 - Kumar (Additional comments)
such as children and the elderly, and marginalized communities, because polluting industries and toxic waste sites tend

2024-01-09 13:51:35 - Rakesh (Additional comments)
Many sources of pollution were unregulated parts of industrialization during the 19th and 20th centuries until the emergence of environmental regulation and pollution policy in the later half of the 20th century.

2024-01-03 10:20:26 - Rakesh (Additional comments)
Pollution has widespread consequences on human and environmental health, having systematic impact on social and economic systems.

2023-12-19 14:11:44 - Rakesh (Additional comments)
Although environmental pollution can be caused by natural events, the word pollution generally implies that the contamin

2023-12-12 12:35:37 - kumar (Additional comments)
Pollution is the introduction of contaminants into the natural environment that cause adverse change.[1]
22302024-01-16 13:17:59 - Kumar (Additional comments)
such as children and the elderly, and marginalized communities, because polluting industries and toxic waste sites tend

2024-01-09 13:51:35 - Rakesh (Additional comments)
Many sources of pollution were unregulated parts of industrialization during the 19th and 20th centuries until the emergence of environmental regulation and pollution policy in the later half of the 20th century.

2024-01-03 10:20:26 - Rakesh (Additional comments)
Pollution has widespread consequences on human and environmental health, having systematic impact on social and economic systems.

2023-12-19 14:11:44 - Rakesh (Additional comments)
Although environmental pollution can be caused by natural events, the word pollution generally implies that the contamin

2023-12-12 12:35:37 - kumar (Additional comments)
Pollution is the introduction of contaminants into the natural environment that cause adverse change.[1]


Expected output:
-------------

IDComments
22872024-01-16 13:17:59 - Kumar (Additional comments)
such as children and the elderly, and marginalized communities, because polluting industries and toxic waste sites tend

22882024-01-13 13:17:59 - Kumar (Additional comments)
such as children and the elderly, and marginalized communities, because polluting industries and toxic waste sites tend

22302024-01-16 13:17:59 - Kumar (Additional comments)
such as children and the elderly, and marginalized communities, because polluting industries and toxic waste sites tend

Hi,

I worked with this sample data

Ashish_Mathur_0-1712979600606.png

and got this result

Ashish_Mathur_1-1712979627555.png

with this M code

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(Source, {{"Comment", Splitter.SplitTextByDelimiter("#(lf)", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Comment"),
    #"Trimmed Text" = Table.TransformColumns(#"Split Column by Delimiter",{{"Comment", Text.Trim, type text}}),
    #"Filtered Rows" = Table.SelectRows(#"Trimmed Text", each ([Comment] <> "")),
    #"Inserted Text Before Delimiter" = Table.AddColumn(#"Filtered Rows", "Datetime", each Text.BeforeDelimiter([Comment], "-", {0, RelativePosition.FromEnd}), type text),
    #"Replaced Value" = Table.ReplaceValue(#"Inserted Text Before Delimiter","",null,Replacer.ReplaceValue,{"Datetime"}),
    #"Filled Down" = Table.FillDown(#"Replaced Value",{"Datetime"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Filled Down",{{"Datetime", type datetime}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"ID"}, {{"Count", each Table.Max(_,"Datetime")}}),
    #"Expanded Count" = Table.ExpandRecordColumn(#"Grouped Rows", "Count", {"Comment", "Datetime"}, {"Comment", "Datetime"})
in
    #"Expanded Count"

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

When i paste that data in MS Excel, i get each comment in a seperate cell but i think those comments (for a specific ID) are in the same cell (seperated with an Alt + Enter).  Please share the download link of the Excel file instead.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur i want the only latest comment in comments column specific to the ID instead of past comments

Yeswanth
Frequent Visitor

hi @v-xuxinyi-msft please check the below comments

Hi @Yeswanth 

 

Thanks for the reply from @Ashish_Mathur , please allow me to provide another insight:

 

I used the latest data you gave, which according to my tests requires you to have a corresponding ID for each comment, otherwise the following will happen.

vxuxinyimsft_0-1713165532504.png

 

no corresponding ID for each row:

vxuxinyimsft_3-1713166524969.png

 

1. Create a calculated column as follows

 

Date = LEFT([Comments], 19)

 

 

2. Create a measure as follows

 

Measure = 
VAR _max = CALCULATE(MAX([Date]), ALLEXCEPT('Table', 'Table'[ID]))
RETURN
IF(MAX([Date]) = _max, 1, 0)

 

 

3. Put the measure into the filter so that the visual only shows data where the measure is equal to 1.

vxuxinyimsft_1-1713166268792.png

 

Result:

vxuxinyimsft_2-1713166295621.png

 

Best Regards,
Yulia Xu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Yeswanth
Frequent Visitor

Hi , Thanks for your support, but please dont divide the date and customer name both are in the same field specific to the id , customer name was not constant it will varies as per the daily updates only 2 columns 
ID : 1
comments: 24/09 hi rakesh
                   19/03 welcome rakesh
                    01/01 bye rakesh 

i want to see the lastest commnet as per the date in commnets column

Yeswanth
Frequent Visitor

Hi thanks for your time but this is not the solution I am looking for 

 

1 ID = MULTIPLE COMMENTS in the same field there is no date in the table in the screenshot having date as a text along with the multiple updates daily so I want to see the latest comments 

v-xuxinyi-msft
Community Support
Community Support

Hi @Yeswanth 

Here is an example of what I did:

 

I restored some of your data.

vxuxinyimsft_0-1712886224695.png

 

1. Create a measure as follows

Measure = 
VAR _max = CALCULATE(MAX([Date]), ALLEXCEPT('Table', 'Table'[Customer]))
RETURN
IF(MAX([Date]) = _max, 1, 0)

 

2. Put the measure into the filter so that the visual only shows data where the measure is equal to 1.

vxuxinyimsft_1-1712886381031.png

 

Result:

vxuxinyimsft_2-1712886404504.png

 

Best Regards,
Yulia Xu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.