Search code examples
excelpowerbipowerquerypowerbi-desktopdata-cleaning

Changing type of Source.Name


When I import a folder with PDF files, the files are ordered incorrectly. When sorting by ascending, the order is 1.pdf, 10.pdf, 11.pdf, 2.pdf,... instead of 1.pdf, 2.pdf, 3.pdf...

enter image description here

I assume this is because the Source.Name column is of the Text type, so the files are sorted lexicographically.

The issue is that I can't change the type of the column. If I try to select Whole Number, or any other type, then every file name becomes an error.

Is there a way to bypass or solve this?

enter image description here


Solution

  • enter image description here

    Highlight column, go to transform ribbon and select extract -> text before delimiter. Use a full stop . for the delimiter. Then you can change the type to whole number.