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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
NagaPushpa
New Member

Truncating the multiline text in a table visual column in power BI report

I have requirement to generate a power BI report which is having live data connection as source. I have added a table visual in my report, which has multiple columns. One of these columns is 'Next Steps'. This column is a multiline text column which has many lines of data. Because of which the row height in the table visual is very large and so the UI is getting disturbed. As I am using live data connection, I am unable to make use of calculated columns. So using below DAX formula, I tried to truncate the lines of data to max of 100 characters and then rest of the data is showing as ellipses. 
But I want to display the rest of the truncated text when hovered or clicked on the ellipses. Can anyone suggest a better way to do this. Only way for me is to use DAX as of now.

 DAX used:
Ellipsed Next steps =
VAR FullText = SELECTEDVALUE(Employee[Next Steps])
VAR MaxChars = 100
RETURN
    IF(
        LEN(FullText) > MaxChars,
        LEFT(FullText, MaxChars) & "...",  -- Truncate the text
        FullText
    )

Sample example:
Emp IDEmp NameEmployee locationNext StepsAssigned to
12345ThanmayeeHyderabadLong text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Manager 1
23456SatvikChennaiLong text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Manager 2
34567MokshaBangloreLong text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Manager 3
45678JagruthiBangloreLong text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Manager 4
56789MohanDelhiLong text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Manager 5
67890SamyukthaHyderabadLong text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Manager 6
2 REPLIES 2
vicky_
Super User
Super User

I think you'd need to create two measures in this case - one for the normal text and one for the truncated. You would use the normal one in a new tooltip page, and then the truncated one would be in your main table.

Thanks for the response.

 

I created 2 separate measure as below.
FullNextSteps = SELECTEDVALUE(Employee[Next Steps])

Ellipsed Next steps =
VAR FullText = SELECTEDVALUE(Employee[Next Steps])
VAR MaxChars = 100
RETURN
IF( LEN(FullText) > MaxChars,
LEFT(FullText, MaxChars) & "...", -- Truncate the text
FullText )
I used the second measure in table visual as a column to display the truncated text. I created a separate custom tooltip page and added first measure to it. Now I am using this tooltip in table visual page. But this tooltip is showing up on all columns. I want to display this tooltip only when hovered on specific column.
Please suggest how can this be done?
NagaPushpa_1-1714635250163.png

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.