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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
markvsql
Resolver I
Resolver I

Power BI Desktop Query Editor Hiding Leading Spaces (Trim)

I have a data source with varying amounts of leading spaces in a text field. it is attached as Figure 1.

 

Figure 1

Source.png

 

You can see that mamy of the values have leading spaces in this Access database table.

 

When I use this table as a source for a Power BI Desktop table, the display in Query Editor shows what is in Figure 2.

 

Figure 2

Figure 2.png

 

Note the values appear to have been Trimmed. However, if I open the Filter dialog on this column, I see the following in Figure 3.

Figure 3

Figure 3.png

The values, again, appear nice and even without leading spaces. However, given the case-sensitive nature of M (and therefore Power Query), there are multiple instances of each Teacher. Each variant in terms of leading spaces is treated as a separate value. Since I created the leading spaces in the Access table on purpose, I know exactly what is happening. However, as a regular user just pulling data from a data source, this would be a VERY confusing scenario is there is no indication in the tool as to why there are multiple instances of each Teacher.

 

I would VERY MUCH prefer to have the Query Editor properly show the leading spaces if they are there. This would provide an indication to the use that they shoudl take some action if this is not what they want in their resulting table. Having both the editor as well as the filter dialog show the spaces would be my preference. 

 

 

2 REPLIES 2
WillT
Community Admin
Community Admin

Hi Mark. You'll find an option in the Query Editor to use a Monospaced font, which will show those spaces. We're tracking bugs to show them in the Data and Report views as well! Thanks Will
doktorg
Frequent Visitor

Has there been any update on this. I have a similar problem but want to view trailing spaces, so when we export the data to csv the trailing white spaces are there.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.