Forum Discussion
Detect data type on all columns in a template
Hi!
I'm trying to create a template for a report and the final step in my query are 'Detect data type' on all my columns.
Unfortunately our data won't always have the same column names, so when we upload it in the template, we need to manually redo the step of detect data because it doesn't recognize the column names. Is it possible to create a step where it is 'Detect data type on all data whatever columns names'?
Thanks a lot!
5 Replies
- ChrisMendoza
Resident Rockstar
MylèneB - Take a look at https://docs.microsoft.com/en-us/powerquery-m/table-columnnames & https://stackoverflow.com/questions/50113354/how-to-refer-columns-in-power-query-by-index-or-position
Here I'm in "Changed Data Type".
- MylèneB
Helper II
Hi Chris! Thank you!
In this way, do I have to know which column will be which type? Because I don't know always know, some of the columns aren't in the same order.
- ChrisMendoza
Resident Rockstar
MylèneB - In the example I suggest, yes, you would need to know the column types. I seem to only be addressing your Column Headings issue and I do not know how to address your issue of different Column order's.
- AnonymousNot applicable
Power Query should automatically detects data, and change data types based on the imported table, you should able to see the signs in front of the column names.
Paul Zheng _ Community Support Team
- MylèneB
Helper II
Hi,
Maybe because I did other steps prior, but it doesn't detect the data type and if I go back to the report, all the visuals are 'broken' because they didn't detect that it was a number for example.
Maybe, there is no workaround and just need to redo the step when creating a new report from my template.