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

I want to show last couple of line from a column out of many lines in a table visual in power bi

Dear Team,
I have an input excel file for my PBI dashboard that has multiple rows & Columns, in one column name called "Update", & in that column our team mates are updating latest status ( text inputs ) on each week. so this column is having multiple lines becoming long list week after week, I have created a simple table visual from the input excel file and in this visuals I want to show last week updats only which contains only couple of lines at each row.
maniknag_0-1616666191003.jpeg

 

Best Regards
Manik Nag
7 REPLIES 7
lbendlin
Super User
Super User

You don't need identifiers.  You need to search for the last occurence of the Line Feed character in your text - character code 10  as I described above.

 

Post some sample data.

Anonymous
Not applicable

Dear Ibendlin,
Can you please provide me the code ( add custome column with M Code )

Yes, right after you provide sample data.

 

Here's how it would look like:

 

    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Last Line", each  Text.AfterDelimiter([Multi Row Text Column],Character.FromNumber(10),{1, RelativePosition.FromEnd}))

 

Note: you can also use "#(lf)" if you want code that is harder to read.

 

Anonymous
Not applicable

Kindly provide your e mail id if possible or let me know how to share the sample PBIX file

Anonymous
Not applicable

Kindly provide your e mail id if possible so that I can send you sample pbix through we transfer

lbendlin
Super User
Super User

Easiest would be to create another column in Power Query (during data load) that uses

Text.PositionOf - PowerQuery M | Microsoft Docs

to find the last carriage return or line feed  (or the absence of it)  and then use Text.Last to get the string after it  (or the entire string if it is only a single line).

 

Doing this in DAX is also possible but a  bit more convoluted.

Anonymous
Not applicable

Thank you for replying , but all text are very dynamic , so I do not have any identifier , all I need to extract last couple of line s from last, anyway kindly provide some example so that I can try further, currently I have only one Identifier "Mar" (i'e'that's the only common text ) from next month it will be "April"

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.