Forum Discussion
Define M Query and its Use
- Anonymous9 years ago
Greg_Deckler : Thanks for your Blog , nicely explained .much appreciated.
v-ljerr-msft : Thank for the reply to error part.
Anonymous
As smoupre has mentioned above, M Query is a mashup query language used to query a multitude of data sources. It contains commands to transform data and can return the results of the query and transformations to Power BI data model. So normally we use M Query to query data sources, clean and load data, then use DAX to analyze the data in Power BI.
Supposingly , I have a Numeric Column in a Table in Query Editor.
When i refresh data , i see there are few records which shows Error in the same column , because there are some special character inserted in the original value in the Database. Can we handle such error with M Query (If yes, please explain the process)
In this scenario, we need to change the data type of that column to Text first, and then create a new custom column where we first check if the value can be converted to a number and otherwise return a default numeric value. See my sample below.
Assume we have a table called MyTestTable which has few records that shows Error in the "Value" column like below.
1. Change the data type of "Value" column to Text.
2. Use the formula below to create a new custom column to do the error handling.
=try Number.From([IntVal]) otherwise 0
Regards
Greg_Deckler : Thanks for your Blog , nicely explained .much appreciated.
v-ljerr-msft : Thank for the reply to error part.