Excel Power Query truncating text field to 1024 characters

1.7k views Asked by At

I am accessing a SSAS DMV through Power Query in Excel via:

let
    Source = AnalysisServices.Database(TabularServerName, TabularDBName, 
             [Query="select * from $SYSTEM.TMSCHEMA_EXPRESSIONS"])
in
    Source

This works great in Power BI, but in Excel, the Expression column is limited to a max of 1024 characters. How do I get Power Query in Excel to give me the entire value? My largest values are around 15000 characters, so still within the stated limits of Power Query that I can find.

If I set up a table with a connection and query behind it, Excel can pull in the entire Expression column, but the downside is the server and database cannot be parameterized and have to be manually changed in the connection. Also I don't remember how to do this manually, so I always have to access the DMV from DAX Studio and export to Excel to set it up!

Update

I did some heavy transformations of this column. I parsed out a value, I used it to merge the file with itself and add a column that I then did a bunch of transformations on, and then used it to replace text within the original problem column. And something in that pulled in the whole value. I tried just doing small parts of this, like adding a column that referenced the problem column, or doing a replace in the problem column, and none of that worked.

So, no, not easy to duplicate or figure out which step fixed it, but for my purposes, I now have what I need.

2

There are 2 answers

1
Grosbeta On BEST ANSWER

I think it is related to the type of the column your are loading in Excel. I had the same issue and read your answer (with Table.ReplaceValue()). Your solution is hiding the initial point: The function used in the expression you shared for Table.ReplaceValue() is Replacer.ReplaceText() that has the additional specificity to convert a field of type Any to type Text. I tried to just change the type of my field that was truncated when loaded in Excel, from type Any to type Text. Result: the complete values were then loaded in my worksheet.

5
Thierry GDL On

I encountered a similar issue:

I loaded an Excel table containing large texts (around 2500 characters per cell) in power query, made some transformations, and wanted to load the result in another sheet.

All my text cells were truncated at 1024 characters. I made some debugging and noticed that the issue disappear if I untick the "Add this data to the Data Model" in the import date pop-up window.

When unticked, my cells are not truncated anymore and contain the complete text generated by the power query.

Hope this helps.