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
zivhimmel
Resolver I
Resolver I

Spaces trimmed

Hi, 

I have a field where I intentially (in the database) have spaces to the left. It's a segment code with dots, and I'm padding spaces to the left to create a sense of indentation. However, when displaying the field in a table, Power BI automatically trimms those spaces to the left. How can I avoid this behaviour?

Here's what it looks like on the report:

10.1

10.1.2

10.1.3

 

But this is how the field actually is:

10.1

    10.1.2

    10.1.3

 

Thanks!

 

1 ACCEPTED SOLUTION

OK, I found what caused it.

'Word wrap' was on. I don't know why it causes this behaviour but turning it off, solves the problem.

Thanks!

 

View solution in original post

4 REPLIES 4
ChrisMendoza
Resident Rockstar
Resident Rockstar

@zivhimmel -

Does this work for you?

Column =
IF (
    LEN ( 'Table'[Column1] ) <= 4,
    'Table'[Column1],
    LEFT ( "     ", 5 ) & 'Table'[Column1]
)





Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Thanks @ChrisMendoza , I don't think it will help.

I've applied the logic in my ubnderlying SQL server view, basically counting how many dots I have in the string

and adding twice as many spaces to the left of the string. I just need Power BI desktop to "respect" these spaces.

OK, I found what caused it.

'Word wrap' was on. I don't know why it causes this behaviour but turning it off, solves the problem.

Thanks!

 

Thank you!

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.