You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For columns with unknown or variable datatypes, it is hard to know the right type conversion method. Using the wrong conversion function in Power Query will cause errors on data load and prevent refreshes from succeeding.
i.e. if you want to compare dates, but don't know what format your input columns is contained in, you can't write a comparison without a risk of errors.
Text to Date is Date.FromText()
DateTime to Date is DateTime.Date()
Number (i.e. Unix/Epoch time) to Date requires significant parsing
Proposed Function
Types can be discovered using Value.Type(), and can be compared using the syntax '[Input] is text'.
A function like "OverrideType( [Input] , text , (errorVal) )' would take the value from the first argument and try to convert it to the type specified in the second argument. Cases where a translation could not be done would return the option value in the third parameter, such as null, a blank text string, or an error statement.
Problem
For columns with unknown or variable datatypes, it is hard to know the right type conversion method. Using the wrong conversion function in Power Query will cause errors on data load and prevent refreshes from succeeding.
i.e. if you want to compare dates, but don't know what format your input columns is contained in, you can't write a comparison without a risk of errors.
Text to Date is Date.FromText()
DateTime to Date is DateTime.Date()
Number (i.e. Unix/Epoch time) to Date requires significant parsing
Proposed Function
Types can be discovered using Value.Type(), and can be compared using the syntax '[Input] is text'.
A function like "OverrideType( [Input] , text , (errorVal) )' would take the value from the first argument and try to convert it to the type specified in the second argument. Cases where a translation could not be done would return the option value in the third parameter, such as null, a blank text string, or an error statement.
More information about Power Query M types can be found in the documentation
The text was updated successfully, but these errors were encountered: